Article ID: 188817
Article Last Modified on 11/21/2006
//(33B0ECE2-E706-11CF-A0C2-00AA00A71DD8)
static const CLSID GCDclsid =
{ 0x33B0ECE2, 0xE706, 0x11CF, { 0xa0, 0xC2, 0x0, 0xaa, 0x0, 0xa7,
0x1d, 0xd8 }};
// (33B0ECE1-E706-11cf-A0C2-00AA00A71DD8)
static const CLSID IGCDclsid =
{ 0x33B0ECE1, 0xE706, 0x11CF, { 0xa0, 0xC2, 0x0, 0xaa, 0x0, 0xa7,
0x1d, 0xd8 }};
void CComjavaView::OnLButtonDown(UINT nFlags, CPoint point)
{
CString str;
LPDISPATCH pDisp;
IGCD VJCom;
VJCom.CreateDispatch(GCDclsid);
pDisp = VJCom.m_lpDispatch;
HRESULT hr = pDisp->QueryInterface( IGCDclsid,
(void**)&VJCom.m_lpDispatch);
if (hr == S_OK)
pDisp->Release();
else
VJCom.m_lpDispatch = pDisp;
str.Format("The least common denominator of 40 and 24 is %d",
VJCom.GCD(40,24));
AfxMessageBox(str);
VJCom.ReleaseDispatch();
CView::OnLButtonDown(nFlags, point);
}
Additional query words: QueryInterface AutoIDispatch
Keywords: kbautomation kbhowto KB188817