Import MFC DLL in C# RRS feed

  • Question

  • Hi everyone,

    I am not sure whether to post this question in this section or C++ Section but I guess ... this is more appropriate.

    I have 2 Classes in MFC which I have to use in my C# Application. I started with exporting those two classes into a MFC Shared DLL.
    The problem I am facing is how to import these MFC classes into my C# application.
    One of the Class goes something like this.

    class __declspec(dllexport) MyBank
            char* LoadBank(char* filename);
            byte* GetData(char* BankID);         
            // other functions

    The second question is how do use pass parameters and receive them in my C# application, since char* is giving unsafe context errors

    Is there any better way to use these classes? Please suggest.

    Thanks :)

    Saturday, May 31, 2008 12:48 AM