Stacy
[...]
[...]
I think the problem is in that string return
value
a "string" is not the same as a pointer to char - at
least
not in the Looking Glass world of VB
Add the following declaration to your VB calling program:
Declare Function lstrcpy Lib "kernel32" Alias
"lstrcpyA" (lpString1 As Any, ByVal lpstring2 As String) As
Long
declare your DLL function like this (note the return
value):
Declare
Function AddUser Lib "cjnhosting.dll" _
(ByVal PUserName As String, ByVal PFullName As String, _ ByVal PGroupName As String, ByVal PActive As Integer) As Long and call it like this
dim retAddUser as long
retAddUser = AddUser(...)
lstrcpy(retAddUser,LString)
I haven't actually tried this so I hope I have this
right.
-ns
|
- [DUG]: Using a Delphi DLL in VB/VBA Stacey Verner
- RE: [DUG]: Using a Delphi DLL in VB/VBA Nello Sestini
- RE: [DUG]: Using a Delphi DLL in VB/VBA Carl Reynolds
- RE: [DUG]: Using a Delphi DLL in VB/VBA Stacey Verner