📄 account.cpp
字号:
// Account.cpp : implementation file
//
#include "stdafx.h"
#include "MFCSample.h"
#include "Account.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAccount
IMPLEMENT_DYNCREATE(CAccount, CCmdTarget)
CAccount::CAccount()
{
EnableAutomation();
// To keep the application running as long as an OLE automation
// object is active, the constructor calls AfxOleLockApp.
AfxOleLockApp();
}
CAccount::~CAccount()
{
// To terminate the application when all objects created with
// with OLE automation, the destructor calls AfxOleUnlockApp.
AfxOleUnlockApp();
}
void CAccount::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CCmdTarget::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(CAccount, CCmdTarget)
//{{AFX_MSG_MAP(CAccount)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CAccount, CCmdTarget)
//{{AFX_DISPATCH_MAP(CAccount)
DISP_PROPERTY_EX(CAccount, "Balance", GetBalance, SetBalance, VT_I4)
DISP_FUNCTION(CAccount, "Post", Post, VT_BSTR, VTS_I4)
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IAccount to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {B7067449-338D-4D3A-AE31-B1B0813673C0}
static const IID IID_IAccount =
{ 0xb7067449, 0x338d, 0x4d3a, { 0xae, 0x31, 0xb1, 0xb0, 0x81, 0x36, 0x73, 0xc0 } };
BEGIN_INTERFACE_MAP(CAccount, CCmdTarget)
INTERFACE_PART(CAccount, IID_IAccount, Dispatch)
END_INTERFACE_MAP()
// {82BFA33F-C2E3-409B-8514-3CB13BB2E26D}
IMPLEMENT_OLECREATE(CAccount, "MFCSample.Account", 0x82bfa33f, 0xc2e3, 0x409b, 0x85, 0x14, 0x3c, 0xb1, 0x3b, 0xb2, 0xe2, 0x6d)
/////////////////////////////////////////////////////////////////////////////
// CAccount message handlers
long CAccount::GetBalance()
{
// TODO: Add your property handler here
return 0;
}
void CAccount::SetBalance(long nNewValue)
{
// TODO: Add your property handler here
}
BSTR CAccount::Post(long lAmount)
{
CString strResult;
// TODO: Add your dispatch handler code here
return strResult.AllocSysString();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -