Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API and external event

Status
Not open for further replies.

jbeetz1

Programmer
Nov 28, 2000
60
0
0
US
I have a PB application (V9.0) that connects to a non PB application by getting the handle of the PB application and sending it to the non PB application. The PB application can now make function calls to the non PB application and this works just fine.

The non PB application can now send to the PB application an event that the PB application needs to react to. How does the PB application capture an event being sent from the non PB application.
 
You cannot do that.There are different types of events in each language.For example.Assuming you have a .NET com written in VB.You cannot from there send an event hopefully be trapped by pb.The only thing you can do in Pb is this

Create an olebject...File - New -Pb Object-standard class
or create an oletxnobject.
Inside you will see an event called external exception.
Place there a messagebox.

In our example now.Make a function in the com object which throws an exception.If in pb you have used the following code to connect to the com object
integer li_rc
oleobject_name lole
/*the name you have just created from file new etc....*/
lole = create oleobject_name

li_rc = lole.connecttonewobject("assembly of the vb com")

if li_rc > 0 then
messagebox("ok" , "connected")
end if

//add code and call your function which throws back an //exception
then you will see the messagebox that you have place in external exception event.
The thing anyway is that Pb sees only public functions and catches expections from a com .And all these if you had connected with the code above.Don't forget to write at the end 2 lines of script
lole.Disconnectobject()
Destroy lole

to deallocate the memory
If you throw something from VB and wants to be caugth by pb and automatically return in VB (example) you will not succeed.Only throws and it sees nothing else than public functions and specific datatypes.
Try to break your code if it is possible so you can call it seperatelly from pb.

I hope i helped you and not confused you

zkar
Programer



 
Zkar

Thanks for the info. I will give it a try.

Jerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top