Re: DirectCom.dll: vb sample -> vfp
- From: "Martin Bauer" <xy@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Nov 2006 14:07:05 +0100
habe noch einen konspirativen Hinweis bekommen :-)
Die Dll sollte eigentlich tun.
Sie wurde mittels PowerBasic erstellt (StdCall-Convention).
GETINSTANCE erwartet als String-Parameter jeweils den Pointer
auf einen Pointer eines ANSI-Strings (in der Original-Deklaration
fehlt ja das sonst übliche ByVal vor den String-Parametern).
Wenn man in VB6 aber folgendermaßen deklariert:
Declare Function GETINSTANCE Lib "DirectCom" _
(ByRef pFName As Long, ByRef pClassName As Long) As Object
...dann muss man das, was VB implizit bei Stringübergaben unter der
Haube durchführt, selbst in die Hand nehmen:
'Beispiel anhand des "Scripting.Dictionary":
Dim D As Object, FName As String, ClassName As String
FName = "scrrun.dll"
ClassName = "Dictionary"
FName = StrConv(FName, vbFromUnicode) 'nach ANSI
ClassName = StrConv(ClassName, vbFromUnicode) 'nach ANSI
Set D = GETINSTANCE(StrPtr(FName), StrPtr(ClassName))
D.Add "123", "123"
Debug.Print D.Count
Hoffe, das hilft erstmal - schau mal, wie Du das in VFP hinbiegst -
vielleicht gibt es in VFP ja auch einen ANSI-String-Typ, dann darf
die Konvertierung von VBs UCS2 nach ANSI entfallen.
die Hoffnung stirbt zuletzt. Nun habe ich
Declare Object GETINSTANCE IN "DirectCom.dll" String@, String@
cDLL = "dh_CtlLoader.dll"
cCLS = "CLoader"
GETINSTANCE(@cDLL, @cCLS)
nix - immer noch Exception. Stelle ich mich nur so an oder ...
Gruß Martin
.
- References:
- DirectCom.dll: vb sample -> vfp
- From: Martin Bauer
- Re: DirectCom.dll: vb sample -> vfp
- From: Martin Bauer
- Re: DirectCom.dll: vb sample -> vfp
- From: Martin Bauer
- DirectCom.dll: vb sample -> vfp
- Prev by Date: Re: DirectCom.dll: vb sample -> vfp
- Next by Date: Farbwert nach RGB zurückwandeln (Umkehr von RGB)
- Previous by thread: Re: DirectCom.dll: vb sample -> vfp
- Next by thread: Re: DirectCom.dll: vb sample -> vfp
- Index(es):
Relevant Pages
|