For those that are interested, I have been able to write
a few bytes to my M500 over USB using the code below.
I have had "more correct" results with the Handspring
version (which I have documented in the handspring-forum).
Anyway, maybe this will help someone who can then
take this further...
(I'm using CPP Builder 5 and the 98DDK)
GB
// Cheating method, ... get the guid from regedit.
// Stolen via Regedit.exe:
#define symbolLinkName
"\\\\.\\0000000000000034#{a5dcbf10-6530-11d2-901f-00c04fb951ed}\\PIPE04"
HANDLE deviceH = INVALID_HANDLE_VALUE;
BOOL success;
unsigned long nBytes;
BULKUSB_CONNECTION_INFO info;
char buf[32] = "your data here";
// Open the device to make sure it is available.
deviceH = CreateFile(symbolLinkName,
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, // no SECURITY_ATTRIBUTES structure
OPEN_EXISTING, // No special create flags
0, // No special attributes
NULL); // No template file
if(deviceH == INVALID_HANDLE_VALUE)
return;
// Check if the device has a connection open >>THIS FAILS!
success = DeviceIoControl(deviceH,
IOCTL_BULKUSB_GET_CONNECTIONS,
&info,
sizeof(info),
&info,
sizeof(info),
&nBytes,
NULL);
//if(success) >>SEND DATA ANYWAY (works!)
success = WriteFile(deviceH, buf, strlen(buf), &nBytes, NULL);
CloseHandle(deviceH);
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/