Hi,
yes, I use OpenWindow() in a thread.
Why?
I only use it to show a message (like 'Wait a moment'), do some stuff and close it.
This is not possible with the standard MessageRequester() and I don't want API, since this program is
used in Windows and Linux.
Since PB 5.0 it is a bit tricky, since I always have to press 'play' to go on.
A 'warning' would be enough in my opinion, so that the program is still running with debugger on.
(Like for deprecated functions 'CreateGadgetList()' for example)
Bernd
Change error to warning when OpenWindow() in thread
Re: Change error to warning when OpenWindow() in thread
Why don't you open your window in main and do the other stuff in a thread?
Re: Change error to warning when OpenWindow() in thread
The problem is it won't work on other OS. For your specific case, you should be able to use a timer, or put DisableDebugger/EnableDebugger around this call (not recommended).
Re: Change error to warning when OpenWindow() in thread
The overhead is to much.eesau wrote:Why don't you open your window in main and do the other stuff in a thread?
I start a serial communication thread,
show 'Please do something' and wait with a timeout on the first received bytes.
If I receive them I go on in the thread else I close it.
And I have several different thread procedures which depends on a selectable modul.
Not every modul has the same requierements.
So I put the 'start stuff' inside the thread procedures.
Trust me, the overhead to implement this complete stuff additional in the main program is enormous.
Bernd
Re: Change error to warning when OpenWindow() in thread
Maybe an other trick is to open the window in the main task and hide it.
Than I show it and hide it inside the thread.
I have to test this.
Bernd
Than I show it and hide it inside the thread.
I have to test this.
Bernd
Re: Change error to warning when OpenWindow() in thread
With 5.10, you will have a PostEvent() command (which can be called from any thread, with a custom event code), so you will be able to ask for the window opening easily.
Re: Change error to warning when OpenWindow() in thread
NICE! (the PostEvent())Fred wrote:With 5.10, you will have a PostEvent() command (which can be called from any thread, with a custom event code), so you will be able to ask for the window opening easily.
I second the 'warning' on openwindow vs. error.
-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: Change error to warning when OpenWindow() in thread
5.0 will go to 5.10? Or 5.1, 5.2 ....?
Thanks
Thanks
Re: Change error to warning when OpenWindow() in thread
It is 5.00, after 5.00 comes next major 5.10, but often comes some bugfix Releasessec wrote:5.0 will go to 5.10? Or 5.1, 5.2 ....?
Thanks
as 5.01, 5.02 or 5.11 without new Features.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: Change error to warning when OpenWindow() in thread
This change broke some of my code. I actually used this feature where I require windows to have independent message queues.
Add a note in the documentation but don't remove features that have been around forever!
Add a note in the documentation but don't remove features that have been around forever!