开发者

P/Invoke - C# signature for Custom Types using DLLImport?

开发者 https://www.devze.com 2023-03-30 09:54 出处:网络
void MyUnmanagedFunc( 开发者_开发百科CustomClass&szOutputData , ICustomObject* pDataObject , const LPCWSTRszTag
void MyUnmanagedFunc(
     开发者_开发百科     CustomClass&   szOutputData
        , ICustomObject* pDataObject
        , const LPCWSTR   szTag
        , const LPCWSTR   szDisplay = NULL
        , const BOOL      bAdd = TRUE
    );

I have the above signature of a function defined in a C++ DLL say, abc.dll. I am not able to create the proper method signature in C#. Note, that the CustomClass is defined in sometherfile, say, xyz.dll and with __declspec(dllexport). I tried this tool to generate the signature.

Sorry, if I have repeated the question. I have tried to search over before posting.


Possible solution is to create mixed assembly written in C++. It can include any necessary headers and call method above from abc.dll and it can expose managed wrapper in the same time.

0

精彩评论

暂无评论...
验证码 换一张
取 消