It appears that your VB.Net code is writing a 32-bit integer value to the memory mapped file. However, in the C++ code the pointer returned by MapViewOfFile is declared as a PCHAR instead of a pointer to an int (i.e., PINT). Following worked for me to print the integer value 100 written by VB to the mapped memory.
#include <windows.h>
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
//int Init;
int main()
{
HANDLE mMF;
PINT vFind = NULL;
mMF = OpenFileMapping(
FILE_MAP_ALL_ACCESS,
FALSE,
L"MM");
if (mMF == NULL)
{
cout << "Failed File Mapping!" << endl;
}
vFind = (PINT)MapViewOfFile(
mMF,
FILE_MAP_ALL_ACCESS,
0,
0, //
256); //array size
if (vFind == NULL)
{
cout << "Failed Map View!" << endl;
}
cout << *vFind << endl;
UnmapViewOfFile(vFind);
CloseHandle(mMF);
return 0;
}