Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check com ports - Ole error
Message
From
09/01/2007 09:01:29
 
 
To
07/01/2007 15:42:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01183302
Message ID:
01183756
Views:
15
As Sergey said, it needs to be hosted on a form. Try something like this:

Re: Serial port communication Message #651442


>Hi All, I am trying to use this com ports check, it works fine on my computer but does not work on any other computers. The error comes up : OLE error code 0x80040112 : Class is not licensed for use. The code I am using is below :
>
>LOCAL oComm, i, cOldErrorHandler
>DECLARE aComPorts[16]
>aComPorts = .T.
>cOldErrorHandler = ON('ERROR')
>FOR i = 1 TO 16
>  oComm = CREATEOBJ('MsCOMMLib.Mscomm')
>  oComm.CommPort = i
>  ON ERROR aComPorts[i] = .F.
>  oComm.PortOpen = .T.
>  oComm.PortOpen = .F.
>  oComm = NULL
>  ON ERROR &cOldErrorHandler
>ENDFOR
>For i = 1 TO 16
>	IF aComPorts[i]
>		MESSAGEBOX([Comm Port ] + ALLTRIM(STR(i)) + [ is valid])
>	ENDIF
>ENDFOR
>
>Your help will be apprecited. Thanking you.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform