ActiveX EXE: RaiseEvent with a form


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: ActiveX EXE: RaiseEvent with a form

Hybrid View

  1. #1
    MatD Guest

    ActiveX EXE: RaiseEvent with a form


    I've been scouring the net, trying to figure out a solution to my problem
    <to no avail>

    I'm new to ActiveX EXE's, so please bear with me. I want to create an ActiveX
    EXE application to run as a separate process (obviously). I have a main
    Standard EXE application that connects to multiple UDP sockets (Winsock).
    I would like this ActiveX EXE to handle all of the UDP/Winsock RX of packets,
    decode and store them into an Access database.

    My problem is this: I have created this project, including the class module
    and 1 form. On the form, I have dropped a Winsock control. Inside the "DataArrival"
    event for Winsock, I would like to be able to raise an event back to the
    main standard EXE application, through the custom class module. However,
    I can't get it to work. I can have the Winsock control call a new method
    in the class (of which I have created an instance of on the form) to raise
    the event inside the class, but it never raises it up to the standard EXE.
    I have declared it within the Std EXE using "WithEvents", and I even stubbed
    in a RaiseEvents within my initialize method, which raises it to the main
    program.

    I've read on various newsgroups that the class is raising the event up to
    the form within the ActiveX EXE, that's why the main application never detects
    it. Can anyone point me into the right direction?

  2. #2
    Zach Blocker Guest

    Re: ActiveX EXE: RaiseEvent with a form


    Workaround: why not roll your own? Create an interface (public) in the ActiveX
    EXE (for the purpose of asynchronous callback). Have the client (the standard
    EXE) implement this interface in an object, and pass an instance of that
    client object to the ActiveX EXE object. Then, when the ActiveX EXE is ready
    to raise the event, it can just call the method in the client object, which
    lives in the standard EXE and can raise an event there.

    "MatD" <vb.@127.0.0.1> wrote:
    >
    >I've been scouring the net, trying to figure out a solution to my problem
    ><to no avail>
    >
    >I'm new to ActiveX EXE's, so please bear with me. I want to create an ActiveX
    >EXE application to run as a separate process (obviously). I have a main
    >Standard EXE application that connects to multiple UDP sockets (Winsock).
    > I would like this ActiveX EXE to handle all of the UDP/Winsock RX of packets,
    >decode and store them into an Access database.
    >
    >My problem is this: I have created this project, including the class module
    >and 1 form. On the form, I have dropped a Winsock control. Inside the

    "DataArrival"
    >event for Winsock, I would like to be able to raise an event back to the
    >main standard EXE application, through the custom class module. However,
    >I can't get it to work. I can have the Winsock control call a new method
    >in the class (of which I have created an instance of on the form) to raise
    >the event inside the class, but it never raises it up to the standard EXE.
    > I have declared it within the Std EXE using "WithEvents", and I even stubbed
    >in a RaiseEvents within my initialize method, which raises it to the main
    >program.
    >
    >I've read on various newsgroups that the class is raising the event up to
    >the form within the ActiveX EXE, that's why the main application never detects
    >it. Can anyone point me into the right direction?



  3. #3
    Guest

    Re: ActiveX EXE: RaiseEvent with a form


    I got it. I ended up creating a reference to the Winsock control on my dummy
    Form from the class. Therefore, the DataArrival callback fired from within
    the class, and I can raise the event from there.

    Thanks for your input.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center