求教,调用动态库中函数,C#中申明该怎样写?

wt_sanlian 2012-08-25 03:27:40
动态库中的函数C语言申明方式是下面这样的

int func1( int , char **);

std::string func2( int );

在 C#里该定义什么样的格式啊,谢谢!
...全文
134 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
iyomumx 2012-08-25
  • 打赏
  • 举报
回复
第一个如楼上
或者用ref string,看具体需求。
第二个用不了,写个C++/CLI吧
tg5156 2012-08-25
  • 打赏
  • 举报
回复
试试这个:http://topic.csdn.net/t/20031211/12/2552240.html
Conmajia 2012-08-25
  • 打赏
  • 举报
回复
[DllImport("abcdefg.dll")]
public static extern int func1(int a,string[] b);

[DllImport("abcdefg.dll")]
public static extern string func2(int a);
Conmajia 2012-08-25
  • 打赏
  • 举报
回复
[DllImport("abcdefg.dll")]
public static extern int func1(int a,string[] b);

[DllImport("abcdefg.dll")]
public static extern string func2(int a);
Conmajia 2012-08-25
  • 打赏
  • 举报
回复
[DllImport("abcdefg.dll")]
public static extern int func1(int a,string[] b);

[DllImport("abcdefg.dll")]
public static extern string func2(int a);

111,096

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧