当前位置:主页>销售管理软件> 列表

关于DLL使用 找管家婆进销存软件

记账软件版1楼: VB中的函数为
Public Declare Function GenClientString Lib "RCClientModulesUpdate.dll" (ByVal pStr As String, ByRef pLen As Long, ByVal DogPassword As Long, ByVal DogCascade As Byte) As Long

Public Declare Function UpdateModule Lib "RCClientModulesUpdate.dll" (ByVal pStr As String, ByVal DogPassword As Long, ByVal DogCascade As Byte, ByVal pLen As Long) As Long
写成DELPHI代码怎么写?

2楼: [code][b]function[/b] GenClientString(pStr: [b]String[/b]; pLen, DogPassword: LongInt; DogCascade: Byte): LongInt; [b]stdcall[/b]; [b]external[/b] ''RCClientModulesUpdate.dll'';

[b]function[/b] GenClientString(pStr: PChar; pLen, DogPassword: LongInt; DogCascade: Byte): LongInt; [b]stdcall[/b]; [b]external[/b] ''RCClientModulesUpdate.dll'';[/code] 如管家婆进销存软件

3楼: function GenClientString(pStr:PChar;var pLen:integer;DogPassword:integer;dogCascade:byte):integer;stdcall; external RCClientModulesUpdate.dll'';

function UpdateModule (pStr:PChar;DogPassword:integer;DogCascade:byte;pLen:integer):integer;stdcall; external ''RCClientModulesUpdate.dll''

4楼: VB中的string翻到DELPHI必须翻成PChar,一定不能string的,Delphi中的String数据类型是一种特殊的数据类型,无法传递给VB或者VC写的DLL的

5楼: 用上面两位的方法还是不行,反不回正确的结果。

6楼: 用function GenClientString(var pStr: Pchar; var pLen; const DogPassword: LongInt; var DogCascade: Byte): LongInt; stdcall; external ''RCClientModulesUpdate.dll''
对了,为什么把pStr付给string变量会出错?

记账软件版7楼: 郁闷:pStr为pChar和pointer时都取不到值。
VB中:
Public DogPassword As Long
Public NetDogResult As Long
Public NetDogData1 As String * 200
Public NetDogBytes As Long
Public DogCascade As Long

NetDogResult = GenClientString(NetDogData1, NetDogBytes, DogPassword, DogCascade)

8楼: function GenClientString(var pStr: pointer; var pLen; const DogPassword: LongInt; var DogCascade: Byte): LongInt; stdcall; external ''RCClientModulesUpdate.dll''

var
s: Pchar;
s := @NetDogData1;
Edit1.Text := s;
以上方法我取到了NetDogData1。
function UpdateModule(var pStr: pointer; var DogPassword: LongInt; var DogCascade: Byte; var pLen: LongInt): LongInt; stdcall; external ''RCClientModulesUpdate.dll''
这个函数中,我怎么样把string付给pStr?