Click to See Complete Forum and Search --> : Is ActiveX DLL running in separate thread?


jgonzale
May 25th, 2001, 03:13 PM
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.

cksiow
May 25th, 2001, 09:51 PM
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

jgonzale
May 26th, 2001, 05:04 PM
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.

jgonzale
June 2nd, 2001, 10:51 AM
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?