[問題] 關於 c# dllimport dll 傳入 char* 參數
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
推
01/11 19:41, , 1F
01/11 19:41, 1F
→
01/11 20:08, , 2F
01/11 20:08, 2F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):