Exposing Winsock_DataArrival Event (or any other event from a .dll) ) in a custom ActveX .dll
I am writing an ActiveX dll, which encapsulates the Winsock Component to perform SMTP commands via port 25 I have written this using the winsock control inside a standard .exe with no problems at all. However in a .dll I can only use the CreateObject(ProgID) in my code
(as there is no form for the control to sit on). Again no problem, I can access the methods and set properties etc... My code relies on the Winsock_DataArrival event to execute certain rules. How can I expose the events of an object instance which has been created programmatically? I have a feeling that the key lies somewhere in either WithEvents or RaiseEvents (or both).
Ideally to keep things as simple as possible, I do not want to use the Winsock API!