I have been trying to solve this for quite a while now and still has no clue. I am hoping some COM expert would be able to help me out here.

Basically, I have a COM server, which is an MFC app. The COM server implements a COM component. Below is what the code looks like.

In myapp.cpp, I have:

BOOL CHllwatchApp::InitInstance()
{
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}

SCODE sc = ::CoRegisterClassObject( CLSID_HLLWATCH,
&m_xMyClassFactory,
CLSCTX_LOCAL_SERVER,
REGCLS_MULTI_SEPARATE,
&m_dwRegister );