title: Write String to Mapped File With Windows Api
body: <p>I'm trying to write a string to a mapped file with c and visual studio.</p>
  
  <pre><code>    ( pFile = (char *) MapViewOfFile(hMMap,FILE_MAP_ALL_ACCESS,0,0,0))
  
      start = pFile;
  
      while(pFile &lt; start + 750){
      *(pFile++) = ' ';
      *(pFile++) = 'D';
      *(pFile++) = 'N';
      *(pFile++) = 'C';
      *(pFile++) = 'L';
      *(pFile++) = 'D';
      *(pFile++) = ' ';
      if(!((pFile - start) % 50))
          *(pFile++) = 10;
      else
          *(pFile++) = ',';
  }
  </code></pre>
  
  <p>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</p>
  
  <pre><code>  sprintf(toFile, "A message of %3d bytes is received and decrypted.\n", strlen(message));
    WriteFile(pFile,toFile,strlen(toFile),&amp;bytesWritten,NULL);
  </code></pre>
  
  <p>this allready...</p>