I have a class decalred inside managed c++ dll as
public class IPHelper
{
public:
static void CheckIP(LPWSTR pSocketName);
static void DebugMessage(const wchar_t *str, ...);
private:
static DWORD GetIPInformation(PSOCKET_RECORD &pInfo);
};
I compiled it successfully and add it as reference to my c# project. I am able to use the namespace, however the class seems empty and I'm unable to call the functions inside it.
Any ideas?
That class is not managed, it is native. You need to call it a public ref class if you want to use it from managed code.
You're going to need to invoke it using the P/Invoke method. See this reference for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With