Windows 8 Developer Preview – Under the hood of COM

The first sample application started showing a COM exception while launching the designer.

IUnknown::Release, IUnknown::Release, IUnknown::Release, … stay tuned

IVisual2011Ptr visualInstance(CLSID_VS2011);
VARIANT_BOOL solidRock;
HRESULT res = visualInstance->get_IsSolidRock(&solidRock);
if (SUCCEEDED(res) && solidRock == VARIANT_TRUE)
{
    wcout << L"VS 2011 is solid rock!" << endl;
}
else
{
    if (FAILED(res))
    {
        wcout << L"The error code " << res << L" is proudly presented by your interop developer of choice." << endl;
    }
    else
    {
        wcout << L"VS 2011 is just a developer preview!" << endl;
    }
}

COM Exception in Designer View

Advertisements