Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MScomm class definition
Message
From
31/05/2005 12:25:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
MScomm class definition
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01018748
Message ID:
01018748
Views:
68
I am trying to create a class definition of that control:
DEFINE CLASS ComReader AS OLEControl 
	OLECLASS = 'MSCOMMLib.MSComm.1'
	poComReader = NULL
	pclastreading = ''
	FUNCTION mInitialize
		susp
		*This.poComReader = CREATEOBJECT('MSCOMMLib.MSComm')
		WITH This
			.Rthreshold = 1
			.CommPort = 8
			.Settings = "9600,N,8,1"
			.InputLen = 20
			.PortOpen = .T.
		ENDWITH
	ENDFUNC	
	Procedure OnComm
		lcInput = CHRTRAN(This.Input, CHR(13),  '')
		lcInput = CHRTRAN(lcInput, CHR(10),  '')
		lcInput = CHRTRAN(lcInput, '*',  '')
		*!* Check if it's the same scan then ignore
		IF This.pcLastReading == lcInput
			RETURN ''
		ENDIF	
		This.pcLastReading = lcInput
		RETURN lcInput
	ENDPROC
	FUNCTION Destroy
		This.PortOpen = .F.
	ENDFUNC	
ENDDEFINE
When I execute this line from command window:
poComReader = NEWOBJECT('comReader', 'd:\foxframework\classes.fxp')
I am getting an error:
Object class is invalid for that container.

Any help?
Next
Reply
Map
View

Click here to load this message in the networking platform