account.cpp

来自「演示了在VC中如何生成和调用com程序,代码简洁,方便.」· C++ 代码 · 共 38 行

CPP
38
字号
// Account.cpp : Implementation of CAccount
#include "stdafx.h"
#include "Bank.h"
#include "Account.h"

/////////////////////////////////////////////////////////////////////////////
// CAccount



STDMETHODIMP CAccount::Deposit(double x)
{
	// TODO: Add your implementation code here
	CurrentValue = CurrentValue+x;
	return S_OK;
}

STDMETHODIMP CAccount::Withdraw(double x)
{
	// TODO: Add your implementation code here
	CurrentValue = CurrentValue - x;
	return S_OK;
}

STDMETHODIMP CAccount::get_CurrentAccount(double *pVal)
{
	// TODO: Add your implementation code here
	*pVal = CurrentValue;
	return S_OK;
}

STDMETHODIMP CAccount::put_CurrentAccount(double newVal)
{
	// TODO: Add your implementation code here
	CurrentValue = newVal;
	return S_OK;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?