Hi,
I am using the following code to send hex data over the serial port:

int str[4] = {0xFF, 0xFF, 0xFF, 0xFF};
BSTR bstr = SysAllocString((OLECHAR*)str);
VARIANT var;
ZeroMemory(&var, sizeof(VARIANT));
var.vt = VT_BSTR;
var.bstrVal = bstr;

Then the WriteFile is: BOOL Write(VARIANT* byteval) { WriteFile(hComm, byteval, sizeof(byteval), &iBytesWritten, NULL); }

Now, I am using a sniffer to check the data I am sending. For some reason data (08 00 00 00) in hex is getting sent. I have chaged the values in str. But whatever the value is in str, I am getting the same data, 0x08 being sent over the serial port.

Please help me to solve this problem. I am stuck here for hours!
Thanks in advance!