Does anyone see anything glarring as to why this writefile command gives me this error when compiling:
53 100 C:\EZInstaller\DevFiles\main.cpp [Error] invalid conversion from 'const void*' to 'HANDLE {aka void*}' [-fpermissive]
This is the code I am using it's from msdn website but does not allow me to compile:
1 2 3 4
char DataBuffer[] = "This is some test data to write to the file.";
DWORD dwBytesToWrite = (DWORD)strlen(DataBuffer);
DWORD dwBytesWritten = 0;
HANDLE hFile = WriteFile("E:\\StateFile.txt", DataBuffer, dwBytesToWrite, &dwBytesWritten, NULL);
That ended up working, tried that before with that but it still gave me the error, but then I realized through the code you supplied that I had HANDLE instead of BOOL for the WriteFile, Thanks!
Anyway, the parameters I used may not be right depending on what you plan on doing with the file. Also I used CreateFileA instead of CreateFile, because personally I hate using wide strings.
Yeah I didn't include my createfile script in the origional post because I didn't think it would effect the compiling of the writefile haha. Any idea how I can point to the write file further in my code? I am trying to record software installations that have occured within that txt.