Managed C++ Bridge DLL
To get MapInfo Pro to call a C# DLL you require a Bridge DLL.
Simply MapInfo Professional cannot call a managed C# DLL, so you create a managed C++ DLL which then calls your managed C# DLL. At this stage I have only got this partially working. But this is what I have got so far.
MI_Bridge.cpp
// This is the main DLL file.
#include "MI_Bridge.h"
#include
#include "stdafx.h"
extern "C" {
#include
}
#using
#using "MI_CS_Sample.DLL"
using namespace System;
using namespace MI_CS_Sample;
extern "C"
{
__declspec(dllexport) void __cdecl bridge_csForm(void)
{
// Local Variables
MI_CS_Sample::csMapInfo __gc *DotNetObject;
// Create new for Object
DotNetObject = new MI_CS_Sample::csMapInfo;
DotNetObject;
}
}
MI_Bridge.h
// MI_Bridge.h // MapInfo C# .NET DLL Bridge #pragma onceOnce I have got this working properly, I will post the remaining code.