managed mem char array to string
Hello,
Given:
struct ToFromPcStruct
{
unsigned long m_dwKeyValue;
unsigned char m_bAction;
ConfigRecord m_cf;
};
and
struct ConfigRecord
{
public:
unsigned long m_Len; // length of record
... unsigned char m_FileName[80];.
...
unsigned short checksum; };
and this code:
ToFromPcStruct* tfpc = new ToFromPcStruct;
Marshal::Copy(bytesReceived, 0, System::IntPtr(tfpc), sizeof(ToFromPcStruct));
tempStr = System::Text::Encoding::ASCII->GetString(bytesReceived)->Substring(sizeof(ToFromPcStruct));
array<String^>^split = tempStr->Split(0);
tempStr = split[0];
Why can I not simply write
tempStr += tfpc->m_cf.m_FileName;
???
Thanks.
Last edited by rrnut; February 11th, 2011 at 05:30 PM..
|