Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


pSendFile bad port handle

Keywords:   comport pSendFile bad port handle

Question:

I am trying to use the pSendFile function. I keep getting a "bad port handle" error. Here is my code:
Addextender("wwser34I.dll")
a = RegqueryValue(@Regmachine, "Software\ISI\NCRCOMM[Comm_Port]")
Spanner = "COM%a%" 

Command1 = "~" 
Command2 = "Wrenchman_Dev"
Command3 = "WX00"
Command4 = "FE"

port = pComOpen(Spanner, 0, 38400, "8N1", "NONXON") 

pPutLine(port, Command1)
pPutline(port, Command2)
pPutline(port, Command3)
pPutline(port, Command4)


;pcomopen("COM%a%" , 0, 38400, "8N1", "NONXON")
psendfile(Spanner , "XMODEM" ,
"d:\Kyrus\Upgradespring2000\scripts\Kyrus.hex", 0, 1)
pcomclose(Spanner, 0)

What am I doing wrong?

Answer:

pSendFile wants the port handle variable returned by pComOpen, not the raw port number.
pSendFile(Port ,"XMODEM","d:\Kyrus\Upgradespring2000\scripts\Kyrus.hex", 0, 1



Article ID:   W14438
Filename:   pSendFile bad port handle.txt