Hi everyone!

I have a problem... I am using a COM DLL (lets call it DLL A) that contains a form with a Winsock OCX control on it.
The job of DLL A is to connect to a remote computer and send and receive text strings from it.

Another DLL (DLL B) is referencing DLL A, and accept event raises from it.

Furthermore, a Standard EXE application, (App EXE) is referencing both DLL A and DLL B.

So the situation is... that DLL B is using events from DLL A, while App EXE is using events from both DLL A and DLL B.

It is my understanding that upon runtime, two instances of the DLL A will be created, one in-process for DLL B, and another in-process for App EXE.

But suppose once the two instances are created, and then the Winscock OCX on DLL A wants to connect to a remote computer. If DLL B calls a public Sub on DLL A, instructing DLL A to send a message to the remote computer through its embedded OCX control, will App EXE also be able to send messages to the same remote computer through DLL A?

In other words, will the two instances of Winsock OCX be able to share the IP connection to the same computer? Or will it not be possible to do so?

This is like saying that if you have a nut and a bolt, and you suddenly create another nut, you cannot connect both to the same bolt, if you have the constraint of a 1-1 connection that you have with a single IP and a single TCP port.

To clarify the problem further:

DLL B -----> DLL A >>> Connected to REMOTE WINSOCK >>> IP 202.33.42.5 port 500

APP Exe -----> DLL A >>> Connected to REMOTE WINSOCK >>> I IP 202.33.42.5 port 500

SEE THE DISCREPANCY ABOVE: TWO INSTANCES OF THE DLL CANNOT CONNECT TO THE SAME IP AND SAME PORT!!!

Whats the solution? is it an Active X EXE Server instead of DLL A ?