用delphi写的dll,其中封装了第三方的com对象,有string类型的参数,但在pb中调用出内存错误
delphi中的声明:
Function ReturnSMS(var sender:widestring; var receiver:widestring; var sms:widestring;
cut:integer; notitle:integer):pchar;
pb中的声明:
Function string ReturnSMS(ref string sender, ref string receiver, ref string sms, int cut, int notitle) library "testdll.dll"
delphi中的声明:
Function ReturnSMS(var sender:widestring; var receiver:widestring; var sms:widestring;
cut:integer; notitle:integer):pchar;
pb中的声明:
Function string ReturnSMS(ref string sender, ref string receiver, ref string sms, int cut, int notitle) library "testdll.dll"
解决方案 »
- 将 form 的 parent 设成 panel 后
- delphi 7.0 导出数据到 excel
- 问个PASCAL语法问题,with do 是什么作用呀?书上没有解释呢?
- 很久没有上来散分,顺便提问一下!请大家关注!
- 不知道是喜还是忧,散分。
- 为什么AdoTable得那么不可靠!成天:Row Can't be located!!
- 关于TADOQuery中虚拟字段的用法问题?
- FileListBox1问题。
- 用Delphi链接ACCEss数据库好,还是用本身开发的数据库好?
- 蛇精病了了
- VB中用数据管理器VisData建ACCESS数据库,DELPHI7中用什么建ACCESS数据库?
- 这种功能怎么实现?
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. }
RTXParams是com对象,对SENDER附值,
paramstr是传递的参数(string,widestring都试过)
RTXParams.Add('SENDER', paramstr);
在pb中调用时出错,
用pchar传参数,在dll将pchar转为string