Personal tools
You are here: Home Members IanT MapInfo and C# Managed C++ Bridge DLL
Document Actions

Managed C++ Bridge DLL

by Ian Tidy last modified 2006-01-16 20:04

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 once
Once I have got this working properly, I will post the remaining code.

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: