Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No READ EVENTS in a COM dll
Message
From
26/06/1999 16:56:54
Raul Davila
Davila Programming Services
Toa Alta, Puerto Rico
 
 
To
26/06/1999 11:45:50
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00234103
Message ID:
00234392
Views:
21
Hi:
The "thisform" is cause the class I made contains a MSWinsock control in it, so I had to base the class on form.

The DataArrival event in the winsock control calls a method in the class passing the arrived data to be processed and depending on the data the class uses the SendData method of the control to respond.

The problem is that this event driven architecture doesn't seem to "fit in" inside a COM dll.

I have to keep beleiving that I just haven't found the way to do it cause I would consider it a big "no-no" for event driven programming not to work inside the COM dll.

As Erik said a WHILE/FOR loop would solve it, but it will swallow the server's resources right away, and this is busy server. I tried it at home and the mouse almost stopped moving!

Any more ideas are welcome.
Thanks

>This is a little confusing. There shouldn't be a "thisform" in a COM DLL. What is it exactly that you are trying to accomplish? If you are trying to hook to the events of the WinSock DLL you might want to look at VFPCOM.DLL. Otherwise, you need to call your DLL from a client that will stay alive during the asynchronous processing that I think you are describing. The client's reference to the object will keep it in scope, which will in turn keep it's members in scope. Then poll the DLL, which will pass through the request to the WinSock object.
>
>I'm not sure if I helped answer the question here because I'm not sure I understand the objective. If this doesn't address the problem please clarify for me and maybe I can help.
>
>>Hi Erik:
>>
>> Tried something like that.
>> I put a timer in the class hoping that it would keep VFP6r running while
>> the winsock control talked to the SMTP server. In the timer event I checkd for CR/LF in the data received, signaling the end of that response.
>>
>>MAILER.START_PROCESS
>> THIS.TIMER.INTERVAL = 100
>> THIS.CHECK_FLAG = .T.
>>
>>TIMER.INTERVAL
>> IF THISFORM.CHECK_FLAG
>> IF (CHR(13) + CHR(10)) $ THISFORM.RECEIVED_DATA
>> THISFORM.CHECK_FLAG = .F.
>> THISFORM.PROCESS_DATA()
>> ENDIF
>> ENDIF
>>
>>MAILER.PROCESS_DATA
>> PROCESS.....
>> ...........
>> THIS.CHECK_FLAG = .T.
>>
>> As you can see the timer is active at all times but it still jumpes out
>> exactly at the same place.
>>
>>This project is 99% complete, obviously this is the only missing part.
>>Any more ideas?
>>
>>TIA
>>
>>>>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.
>>>>
>>>>
>>>>I tried to use READ EVENTS but READ EVENTS does not seem to work
>>>>inside the COM dll.
>>>>
>>>
>>>READ EVENTS is the command that tells VFP to go into a wait state ready for USER input. It relays processing control to the UI. VFP COM dll cannot have a UI. The Vfp6r.dll (the VFP runtime for single threaded COM servers) probably responds to a READ EVENTS by jumping out of the method, because a REASD EVENTS doesn't belong in a COM dll.
>>>
>>>If you want your COM server to wait and poll Winsock, just put in in a loop that checks the ready status of the WinSock control.
R. Davila
DBA / Network Administrator
Administracion de Fomento Comercial
Gobierno de Puerto Rico

Still waiting for FoxPro for LINUX
Previous
Reply
Map
View

Click here to load this message in the networking platform