I'm trying to create a variable using IActiveScriptSite. First an empty array is created in a JS file: var test = []; Then I want to create test[0], test[1], etc in my C++ code. So I tried: hr = m_iActiveScript->AddNamedItem(L"test.0", SCRIPTITEM_CODEONLY| SCRIPTITEM_ISVISIBLE); and hr = m_iActiveScript->AddNamedItem(L"test[0]", SCRIPTITEM_CODEONLY| SCRIPTITEM_ISVISIBLE); Both of these return S_OK, but when I try to access the variable "test. 0" through GetIDsOfNames() I get an error: "Unknown name". (And yes, I know to first try to access "test" - which is OK - then "test.0") So, how to I add/create variables through IActiveScriptSite?? I know I can create the JS code in memory (test[0] = "hello") and pass that to ParseScriptText, but then I won't be able to use a different language if I choose.