CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Location
    Ft. Worth Texas
    Posts
    31

    [RESOLVED] Global Events

    Hello everyone!

    I’m trying to write an Active X DLL that functions like this:
    In a Module.Bas:
    Public anyVariable as Double
    Any number of forms could/would have a reference to the DLL in the Form.Load event.
    Form1: Set MyThingy = New DLL
    Form2: Set MyThingy1 = New DLL
    Form3: Set YourThing = New DLL
    The form would call the function:
    Form1: Call MyThingy.Increment(anyVariable)
    The DLL would increment Module.anyVariable, then generate an OnChange event.
    All forms that have a reference (such as MyThingy) would receive the event.
    Form1: MyThingy.OnChange() would fire.
    Form2: MyThingy1.OnChange() would fire.
    Form3: YourThing.OnChange() would fire.
    The code I have written generates an OnChange event for the form that made the call, but none of the others respond.

    Can someone assist with this?

  2. #2
    Join Date
    Feb 2003
    Location
    Ft. Worth Texas
    Posts
    31

    Re: Global Events

    Ok, So the answer here is to set all forms to the same instance of the DLL:

    Form1: Set MyThingy = New DLL
    Form2: Set MyThingy1 = Form1.MyThingy
    Form3: Set YourThing = Form1.MyThingy

    Now it works!

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

Featured