Call C# Usercontrol/form from unmanaged C++ code

Hi All,

I am trying to call a C# Usercontrol/form from my unmanaged C++ application.
After doing TlbExp / RegAsm, I am able to call the C# exposed methods from
C++ application. But the C# UI is not coming up in my C++ application.
Please let me know whether what I am trying is possible and if "Yes" please
give me some pointers.

Thanks.


Answer this question

Call C# Usercontrol/form from unmanaged C++ code

  • Charles Smith

    Yes, except that this option turns /clr on for all your project. That would be one alternative.

    Another alternative, is to set /clr on for the specific .cpp files that need to be compiled as managed code.

    THanks.

  • arpan_1234

    Is this equivalent to setting the "Use Managed Extensions" to "yes"

    Thanks,
    Shivu

  • ydla

    Why can't you rebuild part of your C++ application with /clr and then just call directly into C#  

    Nikola
    VC++

  • Call C# Usercontrol/form from unmanaged C++ code