我在delphi中做的一个dll里有个函数:
procedure CreateWav(channels : word; resolution : word; rate : longint; fn : string);C#里调用时照你的写法:
public class DLL
{
[DllImport("Project2.dll",EntryPoint="CreateWav")]
public static extern void CreateWav(ushort channels,ushort
resolution,long rate,string
fn);
}
...
DLL.CreateWav(...);
...
没反应,CreateWav根本没执行,而且参数数目、类型可以随便改,编译通过,就是总被忽略
procedure CreateWav(channels : word; resolution : word; rate : longint; fn : string);C#里调用时照你的写法:
public class DLL
{
[DllImport("Project2.dll",EntryPoint="CreateWav")]
public static extern void CreateWav(ushort channels,ushort
resolution,long rate,string
fn);
}
...
DLL.CreateWav(...);
...
没反应,CreateWav根本没执行,而且参数数目、类型可以随便改,编译通过,就是总被忽略
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货