Tremorblue
Programmer
I have a couple of functions that write ansistring to a file or to an internal buffer.
I have been trying to figure out how to convert them to use widestring , can anyone help, Im stuck!
I still need the internal buffer to stay as char.
Thankyou.
void __fastcall TFormMain::WriteDataToFile(int iFileHandle,AnsiString aData)
{
MemoryOrDisk(iFileHandle,aData.c_str(),aData.Length());
}
void __fastcall TFormMain::MemoryOrDisk(int iFileHandle,char *cData,int iLength)
{
if(iFileHandle>0)
{
FileWrite(iFileHandle,cData,iLength);
}else
{
strncpy(&c_InternalBuffer[l_InternalBufferPosition],cData,iLength);
l_InternalBufferPosition+=iLength;
}
}
I have been trying to figure out how to convert them to use widestring , can anyone help, Im stuck!
I still need the internal buffer to stay as char.
Thankyou.
void __fastcall TFormMain::WriteDataToFile(int iFileHandle,AnsiString aData)
{
MemoryOrDisk(iFileHandle,aData.c_str(),aData.Length());
}
void __fastcall TFormMain::MemoryOrDisk(int iFileHandle,char *cData,int iLength)
{
if(iFileHandle>0)
{
FileWrite(iFileHandle,cData,iLength);
}else
{
strncpy(&c_InternalBuffer[l_InternalBufferPosition],cData,iLength);
l_InternalBufferPosition+=iLength;
}
}