Original Post
🔒 Locked
msvc - cant find function
Advertisement
Im just testing out mmapping so here is the entire source as it is:
#include <windows.h>
#include <stdio.h>
#include <stdio.h>
#include <iostream>
using namespace std;
void main()
{
HANDLE hFile = NULL;
hFile = CreateFileForMapping( "test_file.txt", GENERIC_WRITE | GENERIC_READ,
0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
FILE_FLAG_RANDOM_ACCESS );
if( hFile )
cout << "CreateFileForMapping - ok" << endl;
else
return;
hFile = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,5, "test.txt" );
if( hFile )
cout << "CreateFileMapping - ok" << endl;
else
return;
char* file = (char*)MapViewOfFile( hFile, FILE_MAP_WRITE, 0, 0, 0 );
if( file == NULL )
{
cout << "MapViewOfFile - fail" << endl;
return;
}
cout << "file: " << file << endl;
UnmapViewOfFile( file );
}
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement