I'm trying to write a string to a mapped file with c and visual studio.
( pFile = (char *) MapViewOfFile(hMMap,FILE_MAP_ALL_ACCESS,0,0,0))
start = pFile;
while(pFile < start + 750){
*(pFile++) = ' ';
*(pFile++) = 'D';
*(pFile++) = 'N';
*(pFile++) = 'C';
*(pFile++) = 'L';
*(pFile++) = 'D';
*(pFile++) = ' ';
if(!((pFile - start) % 50))
*(pFile++) = 10;
else
*(pFile++) = ',';
}
If i write something like this i can write fine. but i want to write a string this file. How can i do? I have tried
sprintf(toFile, "A message of %3d bytes is received and decrypted.\n", strlen(message));
WriteFile(pFile,toFile,strlen(toFile),&bytesWritten,NULL);
this allready...