COMDemo.cpp
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
- // COMDemo.cpp : Implementation of CCOMDemo
- #include "stdafx.h"
- #include "COMDemo.h"
- #include ".comdemo.h"
- // CCOMDemo
- STDMETHODIMP CCOMDemo::Greeting(BSTR name, BSTR* message)
- {
- CComBSTR tmp("Welcome, ");
- tmp.Append(name);
- *message = tmp;
- return S_OK;
- }
- STDMETHODIMP CCOMDemo::Add(LONG val1, LONG val2, LONG* result)
- {
- *result = val1 + val2;
- FireCompleted();
- return S_OK;
- }
- STDMETHODIMP CCOMDemo::Sub(LONG val1, LONG val2, LONG* result)
- {
- *result = val1 - val2;
- FireCompleted();
- return S_OK;
- }