How to use a dll WithEvents in PowerBuilder?

DudleyDog used Ask the Experts™
I'm trying to help a PowerBuilder programmer (uh ,its not me, it for a friend) who needs to declare a DLL WithEvents.

I do this in VB like this:
Public WithEvents MyObject as MyDll.MyClass

Then any events fired by the dll are handled in the VB code:
Private Sub MyObject_MyEvent()

End Sub

I don't know PB so be gentle.

1. The DLL is already written and works when called from apps written in VB and C++.

2. I need to know how to delcare and use this dll in PowerBuilder so the EVENTS are processed in the PowerBuilder all when fired by the dll.

I gave an example of how to declare and use a dll WithEvents in vb. How is it done in PowerBuilder?

Thanks again.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Hi, if you create your own DLL, in the code use the SendMessage or PostMessage API

 LRESULT SendMessage(
    HWND hWnd,     // handle of destination window
    UINT Msg,     // message to send
    WPARAM wParam,     // first message parameter
    LPARAM lParam);      // second message parameter

having you app window handle and use in the Msg parameter 1024 = WM_USER = pbm_custom01, 1025 = (WM_USER + 1) = pbm_custom02....


Thanks for the info AFI.

Its not exactly what I need so I added some clairification to the original question.
Ok, you can create a new Visual External UserObject and type the DLL Name and the Class Name may be this help you... also you can need to declare custom user events to get the triggered message of the dll.

Did you ever get this working? I'm trying to figure out how to do the same thing. I don't know how to figure out the event ID's of the distiller DLL so that I can trap them in PowerBuilder.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial