CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2001
    Location
    New Jersey
    Posts
    11

    Is ActiveX DLL running in separate thread?

    Hi, all. First time I saw this forum. I'm a newbie to Active X programming and have only been doing VB for a couple of months. Anyway...

    Here's what I Want:

    I want to monitor two networks simultaneously using two network adapter cards in the PC. I have to sniff the networks, meaning I can't use anybody's controls because, I need to see UDP broadcast and point to point. I found out Winsock 2 has a parameter for WSAIoctrl - RCV_ALL, that allows this.

    What I am doing: (may not be correct...any suggestions)
    I am coding in raw Win sockets but for Winsock 2. I am converting/translating all API function calls in the Platform SDK to VB (FUN since I can't use/find a control that will see everything/sniff. So far everything is going well, I only started on Monday. But, since I need two instances, one for each network adapter card, I coded it so far as an ActiveX DLL. I am almost at point of receiving data.

    Here is the question. If I am creating two instances of my ActiveX object from my Main application form, are they running in seperate threads from my Process thread which should be the main form???? I hope this is the case because I would like the ActiveX dll objects to be blocking, only receive data and notify my Main with a receive event. then I can get the data from that object and move into a local buffer for processing, or send the data as a string within the raised event. Will this work?

    If they are not separate threads then I expect that the Main application program GUI and form will appear to be locked up and I'll have to do something different.


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Is ActiveX DLL running in separate thread?

    can't you use winsock control ? if you need two connection, you can just add two winsock controls to your form and it's shouldn't block your main form.

    HTH

    cksiow
    http://vblib.virtualave.net - share our codes


  3. #3
    Join Date
    May 2001
    Location
    New Jersey
    Posts
    11

    Re: Is ActiveX DLL running in separate thread?

    No. I don't need two instances of a Winsock Control. I need one that can sniff the network and see everything including point-to-point messages on the ethernet. In order to see everything you have to write a sniffer and/or use the API functions available in Winsock2 and Win 2000. I looked for a control that would do this, but could not find one. So, I am coding it myself.


  4. #4
    Join Date
    May 2001
    Location
    New Jersey
    Posts
    11

    Re: Is ActiveX DLL running in separate thread?

    FYI. I found the answer to my question by trial and error. It's NO. Worked fine if I put a DoEvents in the Active X Object that was implemented as a DLL. But, was getting errors (maybe processing behind) occasionally.

    Now, I'm trying to implement it as out of process (EXE). Am still getting similar errors. Do I need to call DoEvents too?


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