Open pallammadhukar opened 9 years ago
I guess you are looking for JsProjectWinRTNamespace
function. Using this function you can project a WinRT namespace into the current Chakra context. Here is an exmaple https://github.com/mslavchev/chakra-win10uap/blob/master/src/App1/ChakraDemo.cpp#L74
Hi,
JsErrorCode err; Microsoft::WRL::ComPtr obj;
HStringWrap classId(L"WindowsRuntimeComponent1.Greeter");
Microsoft::WRL::ComPtr factory;
HRESULT hr = RoGetActivationFactory(classId, IID_IActivationFactory, reinterpret_cast<void**>(factory.GetAddressOf()));
assert(SUCCEEDED(hr));
hr = factory->ActivateInstance(&obj);
assert(SUCCEEDED(hr));
JsValueRef ret = nullptr;
err = JsInspectableToObject(obj.Get(), &ret);
assert(JsNoError == err);
Thanks, Pallam Madhukar