Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending string to port com1:
Message
 
 
To
23/06/2005 15:44:34
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01025950
Message ID:
01026035
Views:
24
Nothing happens...

I don´t remember where I read that comm ports can´t be opened with fopen() in VFP... (maybe in help files..)

>Have you tried fopen?
>
>lcstring = "TEST STRING"
>lnhandle = FOPEN("COM1:")
>IF lnhandle <> -1
>   FWRITE(lnhandle,lcstring,len(lcstring))
>   FCLOSE(lnhandle)
>ENDIF
>
>
>
>>Hi.
>>I need to send a string to the communications port COM1:
>>Is there any way other than adding a commcontrol to a form??
>>
>>I found a piece of code posted by Ed Rauh, (post # 12708):
>>
>>
>>DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
>>   STRING @SourceFileName, ;
>>   STRING @DestFileName, ;
>>   INTEGER bFailIfExists
>>IF CopyFile(cMySourceFileName,cMyPortOrUNC,0) # 0
>>   *  It was copied
>>ELSE
>>   *  it wasn't
>>ENDIF
>>
>>
>>
>>It sends a FILE, wich makes me to write a file containing the string i want to send... by now, it works for me.. but my doubt persists.. how can I send just a string??
>>
>>Thanks in advance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform