I am using Visual Studio to create my C++ DLLS. A sample C++ function is
void _stdcall MyFunc(char ** strInput)
{
MessageBox(NULL,"Hi from C++", L"C++ program", NULL);
}
I can then call this function from R by doing the following
dyn.load("Path\myDll.dll")
.C("MyFunc","Hello")
The above code works fine when called from R 64 bit. However, when I compile my DLL as 32 bit DLL and call it from R 32 bit, it crashes after briefly displaying the messagebox. I know that my DLL is working and is a valid 32 bit DLL since I can call its functions from other programs with no problem. Do you know why R 32 bit would be crashing when R 64 bit can handle the same call with no problem?