I don't know alot about c++ builder and I'm maintianing a 'Legacy' app, so please bear with me.
I'm reading binary data from a mscomm port. It seems if I read the data as a string into an AnsiString, it is cut off at the first null. If I read it into a OleVariant, I can't seem to get the data out. I want to be able to concatenate the new data to a unsigned char array containing any unprocessed data.
Here is the last version that I tried:
OleVariant BoxDataIn;
BoxDataIn=BoxPort->Input.ChangeType(varString) ;
BoxDataIn.ChangeType(varArray);
memcpy(tempbuf, BoxDataIn.VArray, size);
memcpy(drtBuf, tempbuf, size);
I don't have any preference to what I need to do to get the end result, I just know that everything I've tried hasn't worked. It's probably a really easy solution too.
I'm reading binary data from a mscomm port. It seems if I read the data as a string into an AnsiString, it is cut off at the first null. If I read it into a OleVariant, I can't seem to get the data out. I want to be able to concatenate the new data to a unsigned char array containing any unprocessed data.
Here is the last version that I tried:
OleVariant BoxDataIn;
BoxDataIn=BoxPort->Input.ChangeType(varString) ;
BoxDataIn.ChangeType(varArray);
memcpy(tempbuf, BoxDataIn.VArray, size);
memcpy(drtBuf, tempbuf, size);
I don't have any preference to what I need to do to get the end result, I just know that everything I've tried hasn't worked. It's probably a really easy solution too.