作者stellvia7 (stellvia)
看板C_Sharp
标题[问题] 关於 c# dllimport dll 传入 char* 参数
时间Mon Jan 11 18:52:34 2010
dll 中
int go_capture(char *name)
{
printf("the name = %s\d",name);
}
c# 中
[System.Runtime.InteropServices.DllImportAttribute("test.dll")]
private static extern int go_capture(char *name);
...
...
...
void button_click(....)
{
string abc="temp_name";
go_capture(abc);
}
上述 go_capture的用法我知道是错的 但我try很久 有的说用unsafe
有个要用Inptr转型 但是一直失败 可以烦请指点吗..
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.130.36.18
1F:推 jhchou:MSDN 查 MarshalAsAttribute Class 01/11 19:41
2F:→ stellvia7:对了我是在wince 上平台.. 01/11 20:08