MyAbc.cpp
上传用户:weisheen
上传日期:2022-07-09
资源大小:19390k
文件大小:1k
- // MyAbc.cpp : Implementation of CMyAbc
- #include "stdafx.h"
- #include "DemoIUnknown.h"
- #include "MyAbc.h"
- /////////////////////////////////////////////////////////////////////////////
- // CMyAbc
- STDMETHODIMP CMyAbc::SetLog(IUnknown *pTools)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- this->pMyTools=pTools;
- return S_OK;
- }
- STDMETHODIMP CMyAbc::add(int a, int b, int *c)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- *c=a+b;
- CString str;
- str.Format("this result is:%d",*c);
- if(this->pMyTools!=NULL)
- {
- ILog* pLog=NULL;
- this->pMyTools->QueryInterface(IID_ILog,(void **)&pLog);
- pLog->writeLog(str.AllocSysString());
- pLog->Release();
- }
- else
- *c=0;
- return S_OK;
- }