cmainwindowwrapper.cpp

来自「《脚本驱动的应用软件开发方法与实践》源码」· C++ 代码 · 共 36 行

CPP
36
字号
//
// CMainWindowWrapper.cpp
//
// --------------------------------------------------------
// A Practical Guide to Script-Driven Software Development
// Author: Qiming Lu                        Date: 6/1/2006
// MSN Messager: luqiming26@hotmail.com
// MSN Blog: http://spaces.msn.com/jemylu
// --------------------------------------------------------

#include "stdafx.h"
#include "safe_defs.h"
#include "CMainWindowWrapper.h"
#include "CButtonWrapper.h"

/////////////////////////////////////////////////////////////////////////////////////////
CMainWindowWrapper::CMainWindowWrapper(ITypeLib* ptl)
	: mButtons(0)
{
	LoadTypeInfo(ptl);
}

CMainWindowWrapper::~CMainWindowWrapper()
{
	SAFE_RELEASE(mButtons);
}

// APIs exposed to scripts
STDMETHODIMP CMainWindowWrapper::get_buttons(IDispatch** ppdisp)
{
	if (mButtons == 0)
		mButtons = new CButtonSet(m_ptl);
	if (mButtons)
		return mButtons->QueryInterface(IID_IDispatch, (void**)ppdisp);
	return E_FAIL;
}

⌨️ 快捷键说明

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