Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM with VFP
Message
De
20/09/1998 09:56:32
Michel Lalonde
Laboratoire Médical Biron
Lachine, Québec, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
COM with VFP
Divers
Thread ID:
00138802
Message ID:
00138802
Vues:
48
I have made an ATL interface that return a value as a [out,retval] and
another one as a [out] only. I have no problem with the retval Variant
but I have a problem getting back the [out] value in VisualFoxPro. I
simplify the problem down this next example.

Ex:

ATL C++ 5.0(sp3)
-----------------------------------------

interface ITest : IDispatch
{
[id(1), helpstring("method TestOut")] HRESULT TestOut([out] VARIANTARG
*pOutVal, [out,retval] VARIANTARG *pRetVal);
};

STDMETHODIMP CTest::TestOut(VARIANTARG *pOutVal, VARIANTARG *pRetVal)
{
VARIANT var;
VariantInit(&var);

VariantInit(pRetVal);
VariantInit(pOutVal);

var.vt = VT_I4;
var.lVal = 50;

VariantCopy(pOutVal, &var);
VariantCopy(pRetVal, &var);

VariantClear(&var);

return S_OK;
}
--------------------------------------------


Works fine in VB 5.0(sp3)

Dim testobj as new Test
Dim vout as Variant
Dim vret as Variant

vret = testobj.TestOut(vout)

Debug.Print vout
Debug.Print vret

OK both vout & vret value are 50
---------------------------------------------------

But in FoxPro 5.0(sp3)
testobj = CreateObject("Test")
vout = 0
vret = testobj.TestOut(@vout)
? vret ---> OK == 50
? vout ----> ERROR == 0

I've tried vret = testobj.testOut(vout) without the @ but it's the samething

Thank you in advance
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform