📄 account.cpp
字号:
// Account.cpp : Implementation of CAccount
#include "stdafx.h"
#include "Bank.h"
#include "Account.h"
#include <stdio.h>
char buffer[200];
/////////////////////////////////////////////////////////////////////////////
// CAccount
STDMETHODIMP CAccount::Deposit(double x)
{
// TODO: Add your implementation code here
sprintf(buffer,"%f",x);
MessageBox(NULL,buffer,"提示",MB_OK);
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;
}
HRESULT CAccount::QueryInterface(REFIID riid,void** ppv)
{
if(riid==IID_IUnknown)
*ppv = (IUnknown*)this;
else if(riid==IID_IAccount)
*ppv = (IAccount*)this;
else
{
*ppv = NULL;
return E_NOINTERFACE;
}
return S_OK;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -