Subj : Re: How to use COM Object? To : borland.public.cpp.borlandcpp From : Manish Agarwal Date : Wed Jun 23 2004 05:24 pm CoInitialize(NULL); IAccount* m_pAccount; HRESULT hr; hr = CoCreateInstance(CLSID_Account, NULL, CLSCTX_SERVER, IID_IAccount, (void **) &m_pAccount); if (FAILED(hr)) { MessageBox("CoCreateInstance failed"); return; } hr = m_pAccount->QueryInterface(IID_IDisplay, (void**) &m_pDisplay); if (FAILED(hr)) { MessageBox("QueryInterface failed"); return; } if (!m_pDisplay) return; hr = m_pDisplay->Show(); if (FAILED(hr)) { MessageBox("Show failed"); return; } m_pDisplay->Release(); m_pDisplay = NULL; CoUnInitialize(); -------------------------------------------- Manish Agarwal http://personal.vsnl.com/mkag "koh" wrote in message news:40d94115$1@newsgroups.borland.com... > > I'm trying to use COM(Component Object Modal) Object which is created by Visual C++. > > How to use? > > .