Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem OCX BSTR data type mismatch
Message
De
25/05/1999 20:07:29
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00222297
Message ID:
00222725
Vues:
20
Hi Rick,

I am pretty sure of using the @ in front of the passed parameters. Here is a working code snippet I have written to access the toolbox:

store 0 to p1x , p1y, p2x, p2y && LONG
store .0 to gp1x, gp1y, gp2x, gp2y && DOUBLE
oMapKit.GetMapRect(@p1x, @p1y, @p2x, @p2y)
oMapKit.LPtoDP(@p1x, @p1y)
oMapKit.LPtoDP(@p2x, @p2y)
oMapKit.DPtoGeoP(0,p1x,p1y,@gp1x,@gp1y)
oMapKit.DPtoGeoP(0,p2x,p1y,@gp2x,@gp2y)
nWidthKM = oMapKit.Distance(0,gp1x,gp1y,gp2x,gp2y)

This is definitely the only way that works in VFP. If I change something I get the 'Type mismatch' again. (Look how I had to initialize the numeric variables to get it running)

-------------------------------
Regarding the BSTR parameter I found that other functions which are returning BSTR as a return value are working. Like:

CLayerName = oMapKit.LayerFile(0)

C++ BSTR GetLayerFile (short nLayer)
Visual Basic GetLayerFile (ByVal nLayer As Integer) As String

It seems that there is a problem with the interface in VFP/Toolbox when I have to initialize a BSTR variable in VFP that then will be altered by the toolbox. Like the c parameter in the next snippet:

store 0 to a,b
store space(19) to c
oObject.GetColumnDefinition(nLayer, nColumn, @a, @b, @c)


Is there a way in VFP to initialize that variable correctly?
(I tried the same function in VB and VC. No problem there)
Sorry I can't answer your question regarding COM as I could not get specific information from the supplier of the toolbox.
Andreas Goldmann
Goldmann Software GmbH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform