What means F(const _variant_t& OptArgs) at import TLB into С++ ?
-
I have TLB of JScript component (.wsc file), I make Import from it, and import creates prototype for functions with one more argument than in JScript "const _variant_t & OptionalArgs" What I must insert into it, once I newer used it in JScript ?? (zero or just pointer - results ti error "invalid poiter") Thanks
inline _variant_t Automation::CreateMenu ( const _variant_t & strChoices, //string const _variant_t & strPrompt, //string const _variant_t & nMaxAttempts, // int const _variant_t & nTimeout, // int const _variant_t & OptionalArgs ) // -- ??? which type { VARIANT _result; VariantInit(&_result); _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_VARIANT, (void*)&_result, L"\x000c\x000c\x000c\x000c\x000c", &strChoices, &strPrompt, &nMaxAttempts, &nTimeout, &OptionalArgs); return _variant_t(_result, false); }
-
I have TLB of JScript component (.wsc file), I make Import from it, and import creates prototype for functions with one more argument than in JScript "const _variant_t & OptionalArgs" What I must insert into it, once I newer used it in JScript ?? (zero or just pointer - results ti error "invalid poiter") Thanks
inline _variant_t Automation::CreateMenu ( const _variant_t & strChoices, //string const _variant_t & strPrompt, //string const _variant_t & nMaxAttempts, // int const _variant_t & nTimeout, // int const _variant_t & OptionalArgs ) // -- ??? which type { VARIANT _result; VariantInit(&_result); _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_VARIANT, (void*)&_result, L"\x000c\x000c\x000c\x000c\x000c", &strChoices, &strPrompt, &nMaxAttempts, &nTimeout, &OptionalArgs); return _variant_t(_result, false); }
I'm not quite sure what you're asking for. But if you don't want to send any optional args at all, then you could do like this:
_variant_t strChoices("Some choices"); _variant_t strPrompt("prompt"); _variant_t nMaxAttempts((long) 1); _variant_t nTimeout((long) 1000); _variant_t OptionalArgs( (long) DISP_E_PARAMNOTFOUND, VT_ERROR); myAutomation->CreateMenu(strChoices, strPrompt, nMaxAttempts, nTimeout, OptionalArgs);
"After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus