Habs jetzt mal mit Createfilemapping versucht:
Mein Problem ist das aber, dass nichts reingeschrieben wird da k immer False is?
Was mach ich falsch?
Mein Problem ist das aber, dass nichts reingeschrieben wird da k immer False is?
Was mach ich falsch?
Code:
char *test; test = (char *)malloc( _MAX_PATH ); test = "Hallo!"; HANDLE hfile; hfile = CreateFileMapping( (HANDLE) 0xFFFFFFFF, NULL, PAGE_READWRITE, 0, sizeof(test), "Testfile"); if (hfile == NULL) cout<<"Fehler"<<endl; HANDLE hmappedfile; hmappedfile = MapViewOfFile( hfile, FILE_MAP_WRITE, 0, 0, 0); unsigned long *writtenBytes; writtenBytes = (unsigned long *)malloc( _MAX_PATH ); bool k = WriteFile(hmappedfile,test,strlen(test),writtenByt es,NULL); cout<<k<<endl;
Comment