www.gusucode.com > VC++中COM组件接口继承的实现(生成DLL)-源码程序 > VC++中COM组件接口继承的实现(生成DLL)-源码程序\code\CalCulate.cpp

    // CalCulate.cpp : Implementation of CCalCulate
#include "stdafx.h"
#include "Test1.h"
#include "CalCulate.h"
// Download by http://www.NewXing.com
/////////////////////////////////////////////////////////////////////////////
// CCalCulate


STDMETHODIMP CCalCulate::Add(long n1, long n2, long *pVal)
{
	// TODO: Add your implementation code here
	*pVal = n1 + n2;
	return S_OK;
}

STDMETHODIMP CCalCulate::Sub(long n1, long n2, long *pVal)
{
	// TODO: Add your implementation code here
	*pVal = n1 - n2;

	return S_OK;
}