my problem is that when I use this:
LPSTR a = "0";
LPSTR b = "1";
LPSTR c = "2";
LPSTR d = "3";
LPSTR e = "4";
TCHAR strex[5];
DWORD x;
myFile = CreateFile("C:\\a.txt", FILE_WRITE_DATA, NULL, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
TCHAR n[5];
StringCchCopy(n, 5, a);
StringCchCat(n, 5, b);
StringCchCat(n, 5, c);
StringCchCat(n, 5, d);
StringCchCat(n, 5, e);
strex = n;
WriteFile(myFile, strex, (DWORD)(sizeof(strex)), &x, NULL);
CloseHandle(myFile);
I get this error for this line: strex = n;
error C2106: '=' : left operand must be l-value
If I change TCHAR strex[5];
to TCHAR strex;
then I get the following errors:
error C2440: '=' : cannot convert from 'TCHAR [5]' to 'TCHAR'
and
error C2664: 'WriteFile' : cannot convert parameter 2 from 'TCHAR' to 'LPCVOID'
Is there anyway to accomplish what I'm trying to do with different code? Help would be appreciated.