Skip to main content

Hi, 

We are currently looking to work with multithread environment. 

We are able to start the multithread where we can call more than 1 program at the same time from the main program. 

But we are having the issue on the toolbar control. 

The issue we face as below.

1) from the main program, call program A, then minimize it. 

2) go back to main program and call program B and minimize it. 

3) go back to main program and call program C and minimize it. 

4) open up the program A and try to click the button in the toolbar, it not function. 

Each individual program will have own toolbar. if we run the program individually not in the multithread environment, it works correctly. 

Only when we made it as multithread environment then the toolbar is not working correctly. 

Anyone have any idea on this issue? 

Thank You. 

Hi, 

We are currently looking to work with multithread environment. 

We are able to start the multithread where we can call more than 1 program at the same time from the main program. 

But we are having the issue on the toolbar control. 

The issue we face as below.

1) from the main program, call program A, then minimize it. 

2) go back to main program and call program B and minimize it. 

3) go back to main program and call program C and minimize it. 

4) open up the program A and try to click the button in the toolbar, it not function. 

Each individual program will have own toolbar. if we run the program individually not in the multithread environment, it works correctly. 

Only when we made it as multithread environment then the toolbar is not working correctly. 

Anyone have any idea on this issue? 

Thank You. 

Hi,

it's a shot in the dark but you display your toolbar like

DISPLAY TOOL-BAR ... HANDLE in wk-toolbar-hnd

Could you check if every program has its own handle ?


Hi, 

We are currently looking to work with multithread environment. 

We are able to start the multithread where we can call more than 1 program at the same time from the main program. 

But we are having the issue on the toolbar control. 

The issue we face as below.

1) from the main program, call program A, then minimize it. 

2) go back to main program and call program B and minimize it. 

3) go back to main program and call program C and minimize it. 

4) open up the program A and try to click the button in the toolbar, it not function. 

Each individual program will have own toolbar. if we run the program individually not in the multithread environment, it works correctly. 

Only when we made it as multithread environment then the toolbar is not working correctly. 

Anyone have any idea on this issue? 

Thank You. 

Is the tool-bar, or the controls on the toolbar the only control in Program 1 that does not work once you "open Program A"? Does the menus in Program A work once you restore it from being minimized?


Is the tool-bar, or the controls on the toolbar the only control in Program 1 that does not work once you "open Program A"? Does the menus in Program A work once you restore it from being minimized?

Hi Shjerpe,

When we restore the program A from minimized the tool bar is still not working. 

We found that the toolbar button that working correctly is those button that also appear in the program B and program C. other button that only appear in program A is not working. 

Thank You. 


Hi,

it's a shot in the dark but you display your toolbar like

DISPLAY TOOL-BAR ... HANDLE in wk-toolbar-hnd

Could you check if every program has its own handle ?

 Hi aw_muench, 

The toolbar is having the same toolbar handle at this point, because we not sure how we should use the different handle since the main program can call any program not always the same 3 program at the same time. 

Thank You. 


Is the tool-bar, or the controls on the toolbar the only control in Program 1 that does not work once you "open Program A"? Does the menus in Program A work once you restore it from being minimized?

Hi Shjerpe, 

We had try to run debugger mode and seem that the program is always refer to the last thread, where is program C.Toolbar in program C is work correctly, the program is program A and Program B cannot have the toolbar work correctly. We had try to use different handles also not working. 

Thank You. 


Hi Shjerpe, 

We had try to run debugger mode and seem that the program is always refer to the last thread, where is program C.Toolbar in program C is work correctly, the program is program A and Program B cannot have the toolbar work correctly. We had try to use different handles also not working. 

Thank You. 

alicetan please have a look at this Documentation page:

Threading Rules that Affect Windows and ACCEPT Statements
https://bit.ly/3zsPlTN

And at the sample that's mentioned at the end of it (Threadds.zip).

This sample makes use of statements that may useful to solve what you are experiencing.


Hi Shjerpe, 

We had try to run debugger mode and seem that the program is always refer to the last thread, where is program C.Toolbar in program C is work correctly, the program is program A and Program B cannot have the toolbar work correctly. We had try to use different handles also not working. 

Thank You. 

While you are using threads to "call" several sub-programs, it does not appears that you are allowing messages from the called program AND then acting  accordingly. It would be best to have Program A call Program B in a thread, and see if you can get Program A to receive a message from Program B. Once you have that working you can expand your thread call to other programs.


alicetan please have a look at this Documentation page:

Threading Rules that Affect Windows and ACCEPT Statements
https://bit.ly/3zsPlTN

And at the sample that's mentioned at the end of it (Threadds.zip).

This sample makes use of statements that may useful to solve what you are experiencing.

Hi Claudio, 

Thanks for the information. We had try to follow the documentation and the sample, we are able to having the thread and we had try to use the SEND and RECEIVE to made sure the thread is talking to each other. 

We had did as below. 

1) In the Menu program having the receive message from thread 

2) In the program A, which is called by menu program have the "Allowing messages" at the accept screen and send message to all thread statement. 

From the above test, when the menu program call the program A, we can see the message send by program A is show. 

So this should be means that the thread is working, if i not mistaken. 

Please correct me if i am wrong. 

But we still face issue on what we want to achieve. 

What we want to achieve is as below. 

1) Menu program call program A (this part is working correctly) 

2) Then minimize program A and go back to menu program 

3) from menu program call program B. (this part i still can work on program B correctly) 

4) then minimize program B, and open up the program A(which is minimize previously), this part cannot work correctly. where we can't do any data input or press the tool bar. 

When run in debugger mode, we saw the thread is stay at the program B, it do not go back to program A. 

Refer to the documentation, if we create the window in MODELESS, it should able to automatically active the thread of the window that we open and suspend the current thread. 

But what we having now is not work according to the documentation. 

Can you share with us any idea cause the program can't work accordingly. 

Thank You. 


While you are using threads to "call" several sub-programs, it does not appears that you are allowing messages from the called program AND then acting  accordingly. It would be best to have Program A call Program B in a thread, and see if you can get Program A to receive a message from Program B. Once you have that working you can expand your thread call to other programs.

Hi shjerpe, 

Thanks for the suggestion. We had try to use the SEND and RECEIVE to made sure the thread is talking to each other. 

We had did as below. 

1) In the Menu program having the receive message from thread 

2) In the program A, which is called by menu program have the "Allowing messages" at the accept screen and send message to all thread statement. 

From the above test, when the menu program call the program A, we can see the message send by program A is show. 

So this should be means that the thread is working, if i not mistaken. 

Please correct me if i am wrong. 

But we still face issue on what we want to achieve. 

What we want to achieve is as below. 

1) Menu program call program A (this part is working correctly) 

2) Then minimize program A and go back to menu program 

3) from menu program call program B. (this part i still can work on program B correctly) 

4) then minimize program B, and open up the program A(which is minimize previously), this part cannot work correctly. where we can't do any data input or press the tool bar. 

When run in debugger mode, we saw the thread is stay at the program B, it do not go back to program A. 

Can you share with us any idea cause the program can't work accordingly. 

Thank You. 


Hi shjerpe, 

Thanks for the suggestion. We had try to use the SEND and RECEIVE to made sure the thread is talking to each other. 

We had did as below. 

1) In the Menu program having the receive message from thread 

2) In the program A, which is called by menu program have the "Allowing messages" at the accept screen and send message to all thread statement. 

From the above test, when the menu program call the program A, we can see the message send by program A is show. 

So this should be means that the thread is working, if i not mistaken. 

Please correct me if i am wrong. 

But we still face issue on what we want to achieve. 

What we want to achieve is as below. 

1) Menu program call program A (this part is working correctly) 

2) Then minimize program A and go back to menu program 

3) from menu program call program B. (this part i still can work on program B correctly) 

4) then minimize program B, and open up the program A(which is minimize previously), this part cannot work correctly. where we can't do any data input or press the tool bar. 

When run in debugger mode, we saw the thread is stay at the program B, it do not go back to program A. 

Can you share with us any idea cause the program can't work accordingly. 

Thank You. 

alicetan,

are you using "BIND TO THREAD" or "LINK TO THREAD" in all of your "DISPLAY ... WINDOW" statements?

Threading Rules that Affect Windows and ACCEPT Statements - https://bit.ly/3zsPlTN


alicetan,

are you using "BIND TO THREAD" or "LINK TO THREAD" in all of your "DISPLAY ... WINDOW" statements?

Threading Rules that Affect Windows and ACCEPT Statements - https://bit.ly/3zsPlTN

Hi Claudio, 

yes, every window we open is code with the “LINK TO THREAD” statement. 

Thank You.