ComSampleServer/Dll.cpp
STDAPI DllUnregisterServer()
{
    HRESULT hr = S_OK;
    
    //  Loop through the global classes table to unregister each class.
    //  Do not bail on failures, continue to unregister whatever we had registered.    
    for (int i = 0; i < ARRAYSIZE(g_Classes); ++i)
    {
        HRESULT hrUnregisterClass = _UnregisterClass(g_Classes[i].rclsid);
        if (FAILED(hrUnregisterClass))
        {
            hr = hrUnregisterClass;
        }
    }

    // Unregister the AppId.
    HRESULT hrUnregisterAppId = _UnregisterAppId(APPID_LOCALSERVER);
    if (FAILED(hrUnregisterAppId))
    {
        hr = hrUnregisterAppId;
    }

    return hr;
}
// Unregisters the DLL.
// This involves two steps
//  1. Unregistering all the classes in the DLL.
//  2. unregistering the AppId that will enable the objects to run as out of proc components inside a surrogate host.

Unregisters the DLL.
This involves two steps
1. Unregistering all the classes in the DLL.
2. unregistering the AppId that will enable the objects to run as out of proc components inside a surrogate host.
Unregisters the DLL . This involves two steps 1 . Unregistering all the classes in the DLL . 2 . unregistering the AppId that will enable the objects to run as out of proc components inside a surrogate host .
STDAPI DllUnregisterServer()
{
    HRESULT hr = S_OK;
    for (int i = 0; i < ARRAYSIZE(g_Classes); ++i)
    {
        HRESULT hrUnregisterClass = _UnregisterClass(g_Classes[i].rclsid);
        if (FAILED(hrUnregisterClass))
        {
            hr = hrUnregisterClass;
        }
    }
    HRESULT hrUnregisterAppId = _UnregisterAppId(APPID_LOCALSERVER);
    if (FAILED(hrUnregisterAppId))
    {
        hr = hrUnregisterAppId;
    }
    return hr;
}
STDAPI DllUnregisterServer ( ) { HRESULT hr = S_OK ; for ( int i = 0 ; i < ARRAYSIZE ( g_Classes ) ; ++ i ) { HRESULT hrUnregisterClass = _UnregisterClass ( g_Classes [ i ] . rclsid ) ; if ( FAILED ( hrUnregisterClass ) ) { hr = hrUnregisterClass ; } } HRESULT hrUnregisterAppId = _UnregisterAppId ( APPID_LOCALSERVER ) ; if ( FAILED ( hrUnregisterAppId ) ) { hr = hrUnregisterAppId ; } return hr ; }
Unregisters the DLL.
Unregisters the DLL .
//  Loop through the global classes table to unregister each class.
 //  Do not bail on failures, continue to unregister whatever we had registered.    
 // Unregister the AppId.
