用PCHAR参数试试看,不要用STRING
解决方案 »
- 批量文件复制
- 请问在DELPHI里怎么把数据的总和取出来保存到数据库中?
- 关于FAQ
- 关于数据显示
- ------各位有谁用过DUnit(Delphi的终极测试器)进行过单元测试?--------
- 一个小问题,很急。。。在线等待。
- windows win32文件格式的问题?高手请进!
- 数据库插入数据,高分...
- 这可否实现,自动记录访问者的E-Mail地址?
- 大家帮忙看一下,此报表为何数据显示不出来?
- 将一个窗体赋予一个窗体变量后,当窗体FREE后,这个窗体变量会发生如何的改变???如何通过这个窗体变量得到窗体已经FREE了?
- 请问我想在用户点击窗体右上角的关闭控制钮时,让用户确认是否真的关闭,应该怎么做??
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }解决方法1:
project2(工程文件,不是单元文件)的uses中第一项(新增加)为ShareMem
project1的uses中第一项(新增加)为ShareMem解决方法2:使用,不用string传递参数
function getMyInfo(myInt1,myInt2:Integer):pchar;StdCall;
begin
Result:=pchar(IntToStr(myInt1+myInt2));
end;
---------------------------------------------------------------------
function getMyInfo(myInt1,myInt2:Integer):pchar;StdCall external 'project1.dll';
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
MessageDlg('Result is:'+string(getMyInfo(2,3)), mtInformation,[mbOk], 0);
end;
同学给我们机会。:)
如果用string可以uses那个me什么单元,然后实时包
帮忙多谢