Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevent crashes Fox
Message
From
31/05/2005 12:04:45
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01018697
Message ID:
01018741
Views:
13
>>>>>>Also what kind of interface should I implement for a vfp class to bind mscomm to?
>>>>>
>>>>>In general, you would use Object Browser to explore a COM object and generate such VFP class.
>>>>
>>>>I have a few questions here.
>>>>In the Object Browser how do I find out what interface to implement?
>>>>
>>>>Since I need to implement a different interface for my contailner does that mean I can't create that contailner in a visual class designer?
>>>
>>>Ususaly there's word Event or Handler in the name of an interface. For mscomm it's DMSCommEvents interface. It can omly be implemented in code.
>>My class definition starts like this:
>>
>>DEFINE CLASS cntTest1 AS Container
>> IMPLEMENTS IMSComm IN "MSCommLib.MSComm"
>>....
>>
>>Is that correct?
>
>No.
DEFINE CLASS myclass AS session OLEPUBLIC
>
>	IMPLEMENTS DMSCommEvents IN "c:\windows\system32\mscomm32.ocx"
>
>	PROCEDURE DMSCommEvents_OnComm() AS VOID;
> 				HELPSTRING "Occurs whenever the value of the CommEvent property changes."
>	* add user code here
>	ENDPROC
>
>ENDDEFINE
I see.
Do I also need something like this in my class:
poComReader = ''
PROCEDURE INIT
This.poComReader = CREATEOBJECT('MSCOMMLib.MSComm')
WITH This.poComReader
.CommPort = 8
.Settings = "9600,N,8,1"
.InputLen = 1
.PortOpen = .T.
ENDWITH
EVENTHANDLER(This.poComReader, This)
ENDPROC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform