delphi7中调用vc做的dll时,参数传递是出现EAccessViolation的错误!

therock1981 2006-02-02 05:23:54
access violation at 0x0044ead1:write of address 0x00000001'.
...全文
148 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
therock1981 2006-02-11
  • 打赏
  • 举报
回复
谢谢各位了!~
comanche 2006-02-08
  • 打赏
  • 举报
回复
delphi function 部分 stdcall 改成 cdecl
beyondtkl 2006-02-08
  • 打赏
  • 举报
回复
vc里调用改成 stdcall 可能不对 LZ试试。
fangerhua 2006-02-08
  • 打赏
  • 举报
回复
function MatOpenEng(p:PChar):Integer;stdcall;external'DpLab.dll';
里面stdcall应该改为cdecl
halfdream 2006-02-05
  • 打赏
  • 举报
回复
两边调用约定不对.
function MatOpenEng(p:PChar):Integer;stdcall;external'DpLab.dll';
里面stdcall应该改为cdecl
wooxer 2006-02-05
  • 打赏
  • 举报
回复
调用约定的问题,在要么改为 halfdream(哈欠) 的办法,要么在VC中加入stdcall语句。
快乐老猫 2006-02-04
  • 打赏
  • 举报
回复
pchar之类的指针需要在调用端开辟空间。
蒋晟 2006-02-03
  • 打赏
  • 举报
回复
http://www.vchome.net/showart.asp?art_id=36&cat_id=2
therock1981 2006-02-02
  • 打赏
  • 举报
回复
vc中的声明

extern "C" __declspec(dllexport) int MatOpenEng(far char *cc)
extern "C" __declspec(dllexport) int MatCloseEng(void)
extern "C" __declspec(dllexport) int MatExec(far char *cc)
extern "C" __declspec(dllexport) int MatCreateDoubleD(char *cc,int num,double dd[])
extern "C" __declspec(dllexport) int MatGetDoubleData(char *cc,int num,double dd[])
therock1981 2006-02-02
  • 打赏
  • 举报
回复
无参数的时候调用好使,一有参数就不行了
出现上面的错误!~
delphi中的声明:
function MatOpenEng(p:PChar):Integer;stdcall;external'DpLab.dll';
function MatCloseEng:Integer;stdcall;external'DpLab.dll';
function MatExec(p:PChar):Integer;stdcall;external'DpLab.dll';
function MatCreateDoubleD(p:Pointer;num:Integer;dd:array of double):Integer;stdcall;external'DpLab.dll';
function MatGetDoubleData(p:Pointer;num:Integer;dd:array of double):Integer;stdcall;external'DpLab.dll';
大熊猫侯佩 2006-02-02
  • 打赏
  • 举报
回复
访问了非法的地址,看看哪里地址搞错了。

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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