2011-04-01 80 views
3

我有DLL函数的DllImport - C型到.NET类型

DLLExport int PatchSomething(char*, char*, DWORD, unsigned char*, unsigned short int); 

,但不能完全传递参数到.NET

F#:

模块RNInvoke

open System 
open System.Runtime.InteropServices 
open Microsoft.FSharp.NativeInterop 
open Microsoft.FSharp.Math 

module Native = 
    [<System.Runtime.InteropServices.DllImport("DesuDLL.dll",EntryPoint="add")>] 
    extern int PatchSomething(char*, char*, DWORD, unsigned char*, unsigned short int); 

或C#

无符号字符210个

错误*无符号短整型

回答

3

试着这么做:

[DllImport("DesuDLL.dll")] 
private static extern int PatchSomething(string a,string b,uint c,string d,ushort e); 

您可能需要扔字符集=自动进入属性了。我唯一担心的是无符号字符指针。