delphi dll返回值报无效的指针操作invalid pointer operetion,设查询结...
发布网友
发布时间:2023-12-27 02:32
我来回答
共2个回答
热心网友
时间:2024-08-13 22:59
看看dll工程单元的开始注释,关于使用string的方法。
{ Important note about DLL memory management: ShareMem must be the
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. }
热心网友
时间:2024-08-13 22:57
在函数体内加个错误扑捉语句就可以实现扑捉错误信息了。