calling .NET DLL from VC++ DLL RRS feed

  • Question

  • We have a VC++ application and DLL developed in VC++ that is interfacing with a device. At present the Interface DLL is shipped with .NET and we do not want to migrate all our platform to .NET yet. So I would like to invoke this .NET DLL written in C# from my VC++ application. I tried to invoke similar way like we do for MFC / Win32 DLL and it failed. So I tried to do that with Managed / Unmanged precompiler tags and compliation options (#pragma and /clr) yet it failed. When I opened the DLL it didn't give me error. But when I look for GetProcAddress or the exported class it is giving no such definition in DLL. If anyone has answer for the same, please advise me.

    Thanks in advance for your efforts.

    Girish Prabhu

    Monday, February 26, 2007 12:27 PM


  • sample would help:

    1. c++ declaration

    2. *.def file example(if exists)

    3. c# usage(if already exist)

    I am assuming of course that we are talking about "c" interface. If your question is about managed wrapper for your c++ class it is a different story.

    Monday, February 26, 2007 12:37 PM