Winsock control wrapped in ActiveX DLL? 
Author Message
 Winsock control wrapped in ActiveX DLL?

Have a question for anyone ...

I am a part of a project that is attempting to create an ActiveX DLL that calls a
Winsock control (all within Visual Basic).  The ActiveX DLL code launches my
application just fine, but when it tries to connect to the application via
Winsock, it seems to hang (WinsockObject.State = 6 = "sckConnecting").  It never
actually makes the connection.

What makes it frustrating is that the exact VB code in an executable can do the
same thing, and can make the connection with no problems.

Is it possible for an ActiveX DLL to use the Winsock control to make a successful
socket connection, and if so, how is the best way of going about it?  Thank you
very much for your time/efforts in reading and/or responding to this question.

David C.



Sun, 14 Sep 2003 06:16:50 GMT  
 Winsock control wrapped in ActiveX DLL?

Quote:

> Have a question for anyone ...

> I am a part of a project that is attempting to create an ActiveX DLL that calls a
> Winsock control (all within Visual Basic).  The ActiveX DLL code launches my
> application just fine, but when it tries to connect to the application via
> Winsock, it seems to hang (WinsockObject.State = 6 = "sckConnecting").  It never
> actually makes the connection.

Can we assume you've got some kind of handler that determines this
condition exists (winsock.state=sckConnecting then ...) and does
something along the lines of winsock.close, <wait some period of
time>, winsock.connect?

Quote:
> Is it possible for an ActiveX DLL to use the Winsock control to make a successful
> socket connection, and if so, how is the best way of going about it?  Thank you
> very much for your time/efforts in reading and/or responding to this question.

Don't know; haven't done that before.  I've got enough trouble
loading them on the fly inside a VB app!  ;-)

--
Jonathan Allan

Neither Mayo Clinic nor I speak for each other unless we explicitly
say so.  You should assume I am speaking only for myself.
Please remove the antispam ".6809" to reply direct to me.  Thanks!



Sun, 14 Sep 2003 21:36:27 GMT  
 Winsock control wrapped in ActiveX DLL?
To answer your first question ... yes, I do have a handler that looks at the
WinsockObject.State immediately after attempting the WinsockObject.Connect
command.

I guess our concern is that we really don't know if an ActiveX DLL can call a
second external DLL (in this case, Winsock).  It seems to compile, but at the
point of "WinsockObject.Connect", it attempts to connect (sckConnecting), but
never gets to sckConnected state.

I have an If/Then/Else statement looking at this WinsockObject.State, waiting for
the connection to be made.  Once made, I can begin sending my information, but
NOT before.

Still open to ideas & opinions

David C.

Quote:
-----Original Message-----

> Have a question for anyone ...

> I am a part of a project that is attempting to create an ActiveX DLL that calls
a
> Winsock control (all within Visual Basic).  The ActiveX DLL code launches my
> application just fine, but when it tries to connect to the application via
> Winsock, it seems to hang (WinsockObject.State = 6 = "sckConnecting").  It never
> actually makes the connection.

Can we assume you've got some kind of handler that determines this
condition exists (winsock.state=sckConnecting then ...) and does
something along the lines of winsock.close, <wait some period of
time>, winsock.connect?

Quote:
> Is it possible for an ActiveX DLL to use the Winsock control to make a
successful
> socket connection, and if so, how is the best way of going about it?  Thank you
> very much for your time/efforts in reading and/or responding to this question.

Don't know; haven't done that before.  I've got enough trouble
loading them on the fly inside a VB app!  ;-)

--
Jonathan Allan

Neither Mayo Clinic nor I speak for each other unless we explicitly
say so.  You should assume I am speaking only for myself.
Please remove the antispam ".6809" to reply direct to me.  Thanks!
.



Sun, 14 Sep 2003 23:24:04 GMT  
 Winsock control wrapped in ActiveX DLL?

Quote:

> To answer your first question ... yes, I do have a handler that looks at the
> WinsockObject.State immediately after attempting the WinsockObject.Connect
> command.

> I guess our concern is that we really don't know if an ActiveX DLL can call a
> second external DLL (in this case, Winsock).  It seems to compile, but at the
> point of "WinsockObject.Connect", it attempts to connect (sckConnecting), but
> never gets to sckConnected state.

> I have an If/Then/Else statement looking at this WinsockObject.State, waiting for
> the connection to be made.  Once made, I can begin sending my information, but
> NOT before.

One of our programmers made the decision to just close the socket
and immediately re-open it under these conditions.  It works (though
I don't quite know why)...  I suspect you'll have to talk to the
fine folks in Redmond about this...

--
Jonathan Allan

Neither Mayo Clinic nor I speak for each other unless we explicitly
say so.  You should assume I am speaking only for myself.
Please remove the antispam ".6809" to reply direct to me.  Thanks!



Mon, 15 Sep 2003 02:52:49 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Wrapping vb.NET Windows contol library dll as COM ActiveX control for use in VB6

2. Winsock Activex DLL and winsock events

3. Winsock control in ActiveX DLL

4. Winsock Control - ActiveX DLL

5. Using a Winsock Control in a ActiveX DLL

6. Using a Winsock Control in a ActiveX DLL

7. call winsock DLL from an ActiveX DLL

8. ActiveX.exe or ActiveX DLL or ActiveX Control?????????????

9. Can Wrap a Activex control?

10. Building ActiveX controls that will access activex.dll running on PWS

11. ActiveX dll vs ActiveX control - Whats the difference

12. Passing ActiveX control as a parrameter to ActiveX.dll

 

 
Powered by phpBB® Forum Software