Hi all,
How to vb script from a C++ code.
the script is like:
Function execute()
.
.
.
.
.
.
.
execute = obj.xml 'obj.xml is a xml
End Function
the script is working fine if i write it in a vbs file and double click on it.
but how to call it from a C++ code.
I tried with IScriptControl::Run but the its not giving any output.
SAFEARRAYBOUND rgsabound[] = { 0, 0 }; // 0 elements, 0-based
USES_CONVERSION;
psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
if (!psa)
{
return E_OUTOFMEMORY;
}
_variant_t outpar = m_pScriptControl->(m_bstrFunction, &psa);
// _bstrFunction = execute
but after execution of this statement outpar is empty.