Results 1 to 2 of 2

Thread: Callback not behaving as expected

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    1

    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

  2. #2
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    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
  •  



Click Here to Expand Forum to Full Width