Hello!
I have connected a n6310 to the COM2 through the phone's serial cable and write this code in C++:
-----
...
void* hPort;
hPort=CreateFile("COM2:",GENERIC_READ|GENERIC_WRITE,0, NULL,OPEN_EXISTING,0,NULL);
AnsiString Message;
DWORD dwNumBytesWritten;
Message="atdt+36702636366\n";
WriteFile(hPort,&Message,18,&dwNumBytesWritten,NULL);
CloseHandle(hPort);
----
but it doesn't work. The CreateFile and WriteFile functions return with 0 error code. The AT command on the Message variable is correct, because it works in HyperTerminal.
Can anybody tell what the problem is?
thanx
I have connected a n6310 to the COM2 through the phone's serial cable and write this code in C++:
-----
...
void* hPort;
hPort=CreateFile("COM2:",GENERIC_READ|GENERIC_WRITE,0, NULL,OPEN_EXISTING,0,NULL);
AnsiString Message;
DWORD dwNumBytesWritten;
Message="atdt+36702636366\n";
WriteFile(hPort,&Message,18,&dwNumBytesWritten,NULL);
CloseHandle(hPort);
----
but it doesn't work. The CreateFile and WriteFile functions return with 0 error code. The AT command on the Message variable is correct, because it works in HyperTerminal.
Can anybody tell what the problem is?
thanx