Quantcast
Channel: SCN : All Content - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 2935

Shared Object programming in powerbuilder 12.5 classic.

$
0
0

Dear Team,

 

Could anybody help me out to write a multi threading application in powerbuilder 12.5 classic?


Objective: In window (w_thread_test) a single line edit control and a button will be there. There will be an infinite loop on the button click event. In this window I want to use a external function which will be user32.dll. In timer event of the window I want to write a code which will check if “Notepad” is open in this machine then close it. In the open event I want to call the timer event in each 5 seconds of interval.


Findings: I have design the above program it is working fine, means if I run the application, system opens the window, during this tenure (when application is running) if I run the “Notepad” application in this system, application checks and close it.


Problem: On button click if I have run the infinite loop then the application doesn’t call the timer event & unable to close the “Notepad” application even the “Notepad” is running. 


Resolution: I have try to code the multi threading features in this application. So I write the following code.

 

Write the following code in the application object “Open” event.

w_thread_test inv_win

 

If SharedObjectRegister ( "w_thread_test", "thread1") = Success! Then

                MessageBox ("Information", "Register Thread Success.", Information!)

                If SharedObjectGet ( "thread1", inv_win) = Success! Then

                                MessageBox ("Information", "Get Object Success.", Information!)

                End If   

End If   

 

Open(w_thread_test)

Open(inv_win)  // This code return -1

 

But the above code is not work.

 

Could anybody help me out to resolve this issue?

 

Thanks

Avishek


Viewing all articles
Browse latest Browse all 2935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>