I have to call a function of an existing application via OLE automation.
The description of this function is as follows:
VARIANT GetItemCount( VARIANT outCountObj)
outCountObj : Specify the receive object for Count.
Sample code:
In JavaScript:
var Obj = { "count" : 0}; // How to do in C++?
var Ret = CMS100w.GetListCount(Obj);
var ListCount = Obj.count;
In VBA:
<Define of Class object>
CountObj
Public count as Integer // Looks easy, but ...
<Code>
Dim obj as CountObj // obj is VARIANT in C++
Set obj = New CountObj // Looks easy, but ...
Ret = CMS100w.GetListCount( obj)
ListCount = obj.count
My main problem is, that obj is not just a simple VARIANT.
So far I haven't found a way to fill the VARIANT outCountObj correctly in C++.
Does anybody know, what the VARTYPE of outCountObj has to be? (VT_DISPATCH?)
And how to fill the VARIANT correctly?
How to create the right VARIANT?
Any help appreciated!
Thank you in advance!
Ingmar
The description of this function is as follows:
VARIANT GetItemCount( VARIANT outCountObj)
outCountObj : Specify the receive object for Count.
Sample code:
In JavaScript:
var Obj = { "count" : 0}; // How to do in C++?
var Ret = CMS100w.GetListCount(Obj);
var ListCount = Obj.count;
In VBA:
<Define of Class object>
CountObj
Public count as Integer // Looks easy, but ...
<Code>
Dim obj as CountObj // obj is VARIANT in C++
Set obj = New CountObj // Looks easy, but ...
Ret = CMS100w.GetListCount( obj)
ListCount = obj.count
My main problem is, that obj is not just a simple VARIANT.
So far I haven't found a way to fill the VARIANT outCountObj correctly in C++.
Does anybody know, what the VARTYPE of outCountObj has to be? (VT_DISPATCH?)
And how to fill the VARIANT correctly?
How to create the right VARIANT?
Any help appreciated!
Thank you in advance!
Ingmar