⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 account.cpp

📁 DCOM论文
💻 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 + -