Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Please sorry for my bad english :(

Here is the situation:

I have a .Net DLL written on C#, witch contains windows form.

MapInfo calls function from this DLL witch opens form.

Is there any way to get instance of MapInfo, that called this function? (Not just first opened instance, because i can have multiple opened)

share|improve this question
    
Have you taken a look at integrated mapping? –  kinkajou May 3 '12 at 8:01
add comment

1 Answer

You can use the MapInfo 11.0 OLE Automation Type Library, and doing this:

public Class test 
{
    public static void MethodCalledFromMapInfo()
    {
        MapInfoApplication _MapInfoApplication = (MapInfo.MapInfoApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("Mapinfo.application");
    }
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.