Hi:
I made a class based on form that has a MSWinsock control in it.
Using the winsock control I connect to a SMTP server to send emails.
It worked flawlessly until I tried to use it in a COM dll.
When the class is run it calls the Connect() method of the control.
The control's DataArrival event passes the arrived data to a
member procedure of the class which processes the data and responds.
Before this event processing READ EVENTS is called to start waiting
for the DataArrival event of the winsock control.
The problem I'm having is that as soon as the class enters this
iddle state, when ran inside the COM dll, it returns immedieatly.
WEBPROCS.PRG
PROCEDURE SENDEMAIL
PUBLIC HTML_TO_BE_RETURNED
HTML_TO_BE_RETURNED = ''
SET CLASSLIB TO MAILER_LIBRARY
oOBJ = CREATEOBJECT('MAILER')
oOBJ.STARTPROCESS()
RELEASE oOBJ
RETURN HTML_TO_BE_RETURNED
MAILER CLASS:
MAILER.STARTPROCESS
THIS.SOCKCONTROL.OBJECT.CONNECT()
READ EVENTS && inside the COM dll this does nothing!
At this point everything is iddle until the winsock control receives
data and fires the DataArrival event which calls the member procedure MAILER.PROCESSDATA(DATA_ARRIVED)
As soon as the methd returns, WEBPROCS.PRG continues to the next line and releases oOBJ.
I tried to use READ EVENTS but READ EVENTS does not seem to work
inside the COM dll.
If I run the class in a local .exe, READ EVENTS holds the application
until the class finishes and calls CLEAR EVENTS. But this does not work when running as a COM dll.
Any help will be greatly appreciated.
TIA
R. Davila
DBA / Network Administrator
Administracion de Fomento Comercial
Gobierno de Puerto Rico
Still waiting for FoxPro for LINUX