我在delphi调用VB编写的DLL函数碰到个问题,请各位大侠帮忙看下。
VB本身调用该DLL文件,按以下方式定义
Declare Function read Lib "JNDll.dll" Alias "rrrr" (ByRef syscode$, ByRef gas_total As Long) As Integer
在调用该DLL的VB中使用以下调用
Dim syscode$
Dim gastotal As Long
st As Integer
st = read(syscode, gastotal)
在VB中执行正确。请教在delphi中该如何定义?
我在delphi中定义函数时,将变量syscode分别定义为string/widestring/pchar/PWideChar,gastotal分别定义为integer/longint/pinteger/PLongint,结果均报错。错误信息:
access violation as oX10002228:write of address 0x0045b2b0
VB本身调用该DLL文件,按以下方式定义
Declare Function read Lib "JNDll.dll" Alias "rrrr" (ByRef syscode$, ByRef gas_total As Long) As Integer
在调用该DLL的VB中使用以下调用
Dim syscode$
Dim gastotal As Long
st As Integer
st = read(syscode, gastotal)
在VB中执行正确。请教在delphi中该如何定义?
我在delphi中定义函数时,将变量syscode分别定义为string/widestring/pchar/PWideChar,gastotal分别定义为integer/longint/pinteger/PLongint,结果均报错。错误信息:
access violation as oX10002228:write of address 0x0045b2b0
解决方案 »
- 怎么在一个按钮的事件中引用另外组件的事件
- DLL工程里 全局变量该如何声明(只在本DLL两个函数中使用)
- TO 数据库的疑难问题?
- 窗体上右上角的那个关闭按钮
- 为什么每天晚上十二点左右,csdn会进不了?
- 关于在delphi中的消息传递,
- 请看看这个玩意是用vb做的,用delphi应该可以做的,但能否提供一个思路……
- 今天早上想导入db文件到sqlserver ,结果打开db文件一看,里面有中文的字段全是乱码。
- 长问题高分求教(成功立即送分):数据库开发中ADO与BDE的可移植性孰好孰差?如果在代码中直接配置,如何去做?
- 关于“全角/半角:”的问题,如何判断一个字符串是否是全角还是半角?
- 请教如何开打一个窗口后,如何关闭前一个窗口
- 大富翁开放了!
delphi函数定义我是这么定义的
read:function(var syscode:PChar;var gas_total:PInteger):Integer;
调用部分这么写的
H := LoadLibrary(pchar('JNDll.DLL'));
read:=GetProcAddress(H, 'rrrr');
errorno:=read(syscode,gas_total);
怎么4楼发着发着就断了