001.
// ScriptControlMacroDispatch.h : interface of the
002.
// CScriptControlMacroDispatch class
003.
//
004.
////////////////////////////////////////////////////////////
005.
006.
#if !defined(AFX_SCRIPTCONTROLMACRODISPATCH_H__FB55B5AF_
007.
00E5_47F5_B176_214B2C7BF19A__INCLUDED_)
008.
#define AFX_SCRIPTCONTROLMACRODISPATCH_H__FB55B5AF_00E5_
009.
47F5_B176_214B2C7BF19A__INCLUDED_
010.
011.
#if _MSC_VER > 1000
012.
#pragma once
013.
#endif // _MSC_VER > 1000
014.
015.
////////////////////////////////////////////////////////////
016.
// CScriptControlMacroDispatch command target
017.
018.
class
CScriptControlMacroDispatch :
public
CCmdTarget
019.
{
020.
DECLARE_DYNCREATE(CScriptControlMacroDispatch)
021.
022.
CScriptControlMacroDispatch();
023.
// protected constructor used by dynamic creation
024.
025.
// Overrides
026.
// ClassWizard generated virtual function overrides
027.
//{{AFX_VIRTUAL(CScriptControlMacroDispatch)
028.
//}}AFX_VIRTUAL
029.
030.
// Implementation
031.
032.
protected
:
033.
//friend class CScriptControlMacroView;
034.
// Generated message map functions
035.
//{{AFX_MSG(CScriptControlMacroDispatch)
036.
// NOTE - the ClassWizard will add and remove member
037.
// functions here.
038.
//}}AFX_MSG
039.
040.
DECLARE_MESSAGE_MAP()
041.
// Generated OLE dispatch map functions
042.
//{{AFX_DISPATCH(CScriptControlMacroDispatch)
043.
afx_msg
void
Test1();
044.
afx_msg
void
Test2();
045.
//}}AFX_DISPATCH
046.
DECLARE_DISPATCH_MAP()
047.
DECLARE_INTERFACE_MAP()
048.
};
049.
050.
// Note: we add support for IID_IScriptControlMacroDispatch
051.
// to support typesafe binding from VBA. This IID must match
052.
// the GUID that is attached to the dispinterface in the
053.
// .ODL file.
054.
055.
// {69AA5686-41AF-4CD9-AEAE-9DB88130E7C1}
056.
static
const
IID IID_IScriptControlMacroDispatch =
057.
{0x69AA5686, 0x41AF, 0x4CD9, {0xAE, 0xAE, 0x9D, 0xB8,
058.
0x81, 0x30, 0xE7, 0xC1}};
059.
060.
////////////////////////////////////////////////////////////
061.
062.
//{{AFX_INSERT_LOCATION}}
063.
// Microsoft Visual C++ will insert additional declarations
064.
// immediately before the previous line.
065.
066.
#endif // !defined(AFX_SCRIPTCONTROLMACRODISPATCH_H__
067.
// FB55B5AF_00E5_47F5_B176_214B2C7BF19A__INCLUDED_)
068.
069.
// ScriptControlMacroDispatch.cpp : implementation of the
070.
// CScriptControlMacroDispatch class
071.
//
072.
073.
#include "stdafx.h"
074.
#include "ScriptControlMacroDispatch.h"
075.
076.
#ifdef _DEBUG
077.
#define new DEBUG_NEW
078.
#undef THIS_FILE
079.
static
char
THIS_FILE[] = __FILE__;
080.
#endif
081.
082.
////////////////////////////////////////////////////////////
083.
// CScriptControlMacroDispatch
084.
085.
IMPLEMENT_DYNCREATE(CScriptControlMacroDispatch, CCmdTarget)
086.
087.
CScriptControlMacroDispatch::CScriptControlMacroDispatch()
088.
{
089.
EnableAutomation();
090.
}
091.
092.
BEGIN_MESSAGE_MAP(CScriptControlMacroDispatch, CCmdTarget)
093.
//{{AFX_MSG_MAP(CScriptControlMacroDispatch)
094.
// NOTE - the ClassWizard will add and remove mapping
095.
// macros here.
096.
//}}AFX_MSG_MAP
097.
END_MESSAGE_MAP()
098.
099.
BEGIN_DISPATCH_MAP(CScriptControlMacroDispatch, CCmdTarget)
100.
//{{AFX_DISPATCH_MAP(CScriptControlMacroDispatch)
101.
DISP_FUNCTION(CScriptControlMacroDispatch,
102.
"Test1"
, Test1, VT_EMPTY, VTS_NONE)
103.
DISP_FUNCTION(CScriptControlMacroDispatch,
104.
"Test2"
, Test2, VT_EMPTY, VTS_NONE)
105.
//}}AFX_DISPATCH_MAP
106.
END_DISPATCH_MAP()
107.
108.
BEGIN_INTERFACE_MAP(CScriptControlMacroDispatch, CCmdTarget)
109.
INTERFACE_PART(CScriptControlMacroDispatch,
110.
IID_IScriptControlMacroDispatch, Dispatch)
111.
END_INTERFACE_MAP()
112.
113.
////////////////////////////////////////////////////////////
114.
// CScriptControlMacroDispatch message handlers
115.
116.
void
CScriptControlMacroDispatch::Test1()
117.
{
118.
// TODO: Add your dispatch handler code here
119.
120.
AfxMessageBox(CString(_T(
"\""
)) + GetDispatchMap()->
121.
lpEntries->lpszName + _T(
"\"
method call of
122.
the \
""
) + RUNTIME_CLASS(
123.
CScriptControlMacroDispatch)->m_lpszClassName
124.
+ _T(
"\" class"
), MB_ICONASTERISK);
125.
}
126.
127.
void
CScriptControlMacroDispatch::Test2()
128.
{
129.
// TODO: Add your dispatch handler code here
130.
131.
AfxMessageBox(CString(_T(
"\""
)) + GetDispatchMap()->
132.
lpEntries[1].lpszName + _T(
"\"
method
133.
call of the \
""
) + RUNTIME_CLASS(
134.
CScriptControlMacroDispatch)->m_lpszClassName
135.
+ _T(
"\" class"
), MB_ICONASTERISK);
136.
}