0

C dll でいくつかの機能を使用するために DLL インポートを使用しています。関数のシグネチャは

int dllfunction(myfile **fptr, const char *filename, int *status);

関数にアクセスできるように、次の行にどのマーシャリング コードを入力しますか?

[DllImport("name.dll")]
public static extern int dllfunction(??);

私が試してみました

[DllImport("name.dll")]
public static extern int dllfunction(
    IntPtr fptr,
    [In] ref char filename, 
    ref int status);

MSDN を調べてもまだ役に立ちません。返信できる場合は、呼び出しの例も示していただけませんか (つまり、キャストが必要な場合)。

ご覧いただきありがとうございます。

バック

4

1 に答える 1

2

これは、投稿されたわずかな情報からの最良の推測です。

[DllImport("name.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int dllfunction(
    out IntPtr fptr, 
    string filename, 
    ref int status
);
于 2013-04-25T02:00:55.220 に答える