vc++ に dll があり、対応するヘッダー ファイル (.h ファイル) があります。この dll を c# で呼び出す必要があります。また、呼び出し規約についてはまったくわかりません。
ヘッダー ファイルには、次のような関数プロトタイプがあります。
typedef void CBOnStop_VC( int nFGHandle, unsigned int nChannel, void* pClientData );
ここで、C# でこの関数を呼び出したいと思います。
何か案が?
vc++ に dll があり、対応するヘッダー ファイル (.h ファイル) があります。この dll を c# で呼び出す必要があります。また、呼び出し規約についてはまったくわかりません。
ヘッダー ファイルには、次のような関数プロトタイプがあります。
typedef void CBOnStop_VC( int nFGHandle, unsigned int nChannel, void* pClientData );
ここで、C# でこの関数を呼び出したいと思います。
何か案が?
これらの手順を使用できます
1. compile your classe with the /clr switch
#include "NativeType.h"
public ref class ManagedType
{
NativeType* NativePtr;
public:
ManagedType() : NativePtr(new NativeType()) {}
~ManagedType() { delete NativePtr; }
void ManagedMethod()
{ NativePtr->NativeMethod(); }
};
2.Add a reference to your ManagedType assembly
ManagedType mt = new ManagedType();
mt.ManagedMethod();