|
-
Aug 2nd, 2001, 08:45 AM
#1
Thread Starter
New Member
Callback not behaving as expected
Hi. I want my ActiveX server to notify the client (another ActiveX EXE) of events using a callback interface.
I defined a simple dll with a single method called NotifyMe(). I compiled the dll as INotify.dll
Both my projects reference this dll.
In my client I use Implements INotify.NotifyMe
Private Function INotify_NotifyMe() As Variant
MsgBox "it works"
End Function
My server has a registration Method:
Private mNotify as INotify.NotifyMe
Public Function RegisterNotification(ByRef iNotify as NotifyMe)
Set mNotify = iNotify
End Function
So far so good. Everything compiles, no errors. The problem is when the server calls the event nothing happens.
I have a timer that calls mNotify.NotifyMe
What I expect to happen is the implementation on the client to run and the Msgox to appear. But nothing happens. What am I missing? How do I invoke the callback back on the client?
Thanks,
Rob
-
Aug 2nd, 2001, 12:01 PM
#2
Addicted Member
One thing you might try.
You can expose a public method on your server component. Set a reference to that server component in your client component. And call into that method and raise your message there.
MyServer.exe
private objMyClient as MyClient
Class Initalize
set objMyClient = new MyClient
set objMyClient.CallBackObject = me
objMyClient.MyMethod
Public sub CallBack
msgbox, etc....
end sub
MyClient.dll
private objMyCallBack as MyServer
Public property set (lpCallBack as object)
set objMyCallBack = lpCallBack
end property
public Sub MyMethod()
objMyCallBack.CallBack
end Sub
Something like this might be able to work for ya. Hope it helps
That which does not kill us, only makes us stronger. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|