How to trigger an event from within a bas module
Posted on 2003-03-17
I have a DLL. Inside the DLL I have a class module and bas module.
I am using the DDEInitialize api routine. It uses a property that points to a bas module function.
When this bas module function runs I need to pass a value back up to the parent program. You can't create a event from within the bas module which is how I've been passing information back to the parent program. How can I pass some information back to a parent program if the function resides inside a bas module within a DLL? If I move the DDECALLBACK into the class module I get an error since the api expects a public function pointer.
Is there a way to make a pointer to a function that resides in a class? I'm lost on this one.
Public Declare Function DdeInitialize Lib "user32" Alias "DdeInitializeA" _
(pidInst As Long, _
ByVal pfnCallback As Long, _
ByVal afCmd As Long, _
ByVal ulRes As Long) As Integer
If DdeInitialize(g_lInstID, AddressOf DDECallback, APPCMD_CLIENTONLY Or MF_SENDMSGS Or MF_POSTMSGS, 0) Then
Debug.Print "DDE Initialize Failure."
Debug.Print "DDE Initialize Success."
Initialize = True