Jump to content

create COM Variant


Recommended Posts

Hi Folks,

I am currenty trying to improve my ADO Toolkit, but I have reached a point, where I can't find a solution for this specific problem:

post-885-1169726816.png?width=400

The variant input "Restrictions" of the Invoke Node "OpenSchema" needs a special input which is defined as follows:

_bstr_t bstrTableType("Table");	 	 varCriteria[0].vt = VT_EMPTY;	 varCriteria[1].vt = VT_EMPTY;	 varCriteria[2].vt = VT_EMPTY;	 varCriteria[3] = bstrTableType;	 	 VARIANT varData;	 SAFEARRAY FAR* psa;	 SAFEARRAYBOUND rgsabound[1];	 rgsabound[0].lLbound = 0;	 rgsabound[0].cElements = 4;	 psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);	 	 // Fill the safe array.	 for( lIndex = 0; lIndex < 4;lIndex++)	 {		hr  = SafeArrayPutElement(psa, &lIndex,&varCriteria[lIndex]);	 }	 // Initialize variant with safearray.	 varData.vt = VT_VARIANT | VT_ARRAY;	 V_ARRAY(&varData) = psa;				  	 Con.CreateInstance(__uuidof(ADODB::Connection));	 Con->Open(L"DSN=pubs", L"", L"", -1L);	 	 Rs1 = Con->OpenSchema(ADODB::adSchemaTables,varData);

does anyone know, how to build that specific variant, which is passed to the function OpenSchema(ADODB::adSchemaTables,varData) ?

Furthermore this problem does not only concern this example, but there are other cases, where I'd like to pass a *variant structure* (??) to an ActiveX Invoke node, e.g. if you use the Internet Explorer Object and invoke the print method, you need to pass a *special* varaiant to the method, too, in order to remove the default print headers (wich look pretty uggly ...)

Maybe such variants can be created by calling *other* ActiveX Invoke or Property nodes - but which class should I use ?

Any help would be realy appreciated!

Link to comment
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.