How to call a com object's method that takes VARIANT * parameters?
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I have a foxpro component that take two VARIANT* as parameters. How do I populate these two parameters and call IDispatch::....?
Well it depends on what you want to put in the variant... but first you would do something like this... VARIANT v1,v2; VariantInit(&v1); VariantInit(&v2); then depending on what you are putting in there you have to fill in the vt... v1.vt = VT_BSTR; // for a bstr v1.vt = VT_I2; // for an int v1.vt = VT_I4; // for a long etc... then you would call your method yourobj->yourmethod(&v1,&v2);