//dll的问题,delphi7下编译
function Test1(sTmp1, sTmp2: string): string;stdcall;
begin
Result := sTmp1 + sTmp2;
end;exports
Test1;//调用
var
sTmp1: string;
sTmp2: string;
sTmp3: string;
begin
sTmp1 := '66';
sTmp2 := '77';
sTmp3 := Test1(sTmp1,sTmp2);
ShowMessage(sTmp3);
end;
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EInvalidPointer with message 'Invalid pointer operation'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
报错
解决方案 »
- 如何获取外网上网地址IP(非本机IP)
- 使用SPComm做一个串口通讯的问题
- 如何缩放 f1book 的打印预览?万分感谢
- 简单
- 我用CheckListbox1框,裡面有10行,我任意選其中3或2行,我希望被選中的行顯示紅色,怎麼做呢?
- 请问如何把字符串型(string)转换成色彩型(tcolor)变量呢?
- 高手请进:Webbrowse打开窗口,怎样在动态生成的新的WebBrowse中取得打开的URL地址;
- Jinglihui (雪狐) 如果还是缺分的话请进
- 请问Delphi6.0中UdpSock组件在哪?注意是UdpSock不是UdpSocket!!进去再说!!!!
- 关于Dbgrid的!!!
- 关于delphi下modbusRTU应用问题中关键CRC校验计算
- DBGrid 选中行 返回首列
external 'dll\Main.dll';
2.最好在dll中函数的返回值不要用string类型
external 'dll\Main.dll';这样最好指明具体路径
//
use
shareMem
楼主换成整型肯定没问题的
楼上说引用错了,请明示
1.function Test1(sTmp1, sTmp2: string): string; stdcall; external 'dll.dll';
2.另外就是在dll要加ShareMem单元引用。
3.在调用dll程序的project单元,要加sharemem单元引用。
4.另外在调用程序中加上borlndmm.dll,这个文件。
基本就没什么问题了。
//delphi 7,xp系统,我们就是这么处理的。
要么是这种:function Test1(sTmp1, sTmp2: string): string; stdcall; external 'D:\dll\Main.dll';