调用dll时找不到函数

hcyang 2006-10-08 04:59:38
dll代码:
using System.Security.Permissions;

[System.AttributeUsageAttribute(System.AttributeTargets.Class|System.AttributeTargets.Struct, AllowMultiple=true)]
public class Author : System.Attribute {
public static void Main() {}
public Author(string name) { this.name = name; version = (float) 1.0; }
public Author(int name) {}
public Author() {}
public float version;
private string name;
public int[] rgnField;
public double [] rgdField;
}

[System.Security.Permissions.PermissionSetAttribute(SecurityAction.Demand)]
[ABC(SomeStuff.e17)]
[ABC(1, rgdField=new double[2] {6, 1.2})]
[ABC, ABC("99"), ABC(1, rgnField=new int[2] {1, 2})]
[ABC, ABC("99"), Author(1, rgnField=new int[2] {1, 2})]
public class MYStuff {
}

vc中代码:
HINSTANCE hInst = LoadLibrary("Author.dll");
typedef (*MYFUNC)(int name);
MYFUNC fun;
fun = (MYFUNC)GetProcAddress(hInst, "Author");
if(fun != NULL)
{
cout << fun(30) << endl;
}
FreeLibrary(hInst);

这样写找不到Author这个函数,请问是什么原因,thanks
...全文
287 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hcyang 2006-10-08
  • 打赏
  • 举报
回复
谢谢,继续等高手帮忙
rickerliang 2006-10-08
  • 打赏
  • 举报
回复
这个是托管的dll来的,好像不能直接导出吧。
.Net的东东好久没碰了,对不起,帮不了你

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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