方法添加 错误
我在DevStudio Add-in Wizard 创建了 一个工程 在ICommands 接口添加了 一个方法 我用的VC++
// quite.odl : type library source for quite.dll
// This file will be processed by the Make Type Library (mktyplib) tool to
// produce the type library (quite.tlb).
[ uuid(4C66AFD1-53B2-44AD-A178-D808B3A7770E), version(1.0),
helpstring ("QUITE Developer Studio Add-in") ]
library Quite
{
importlib("stdole32.tlb");
importlib("devshl.dll");
importlib("ide\devdbg.pkg");
// Dual interface for CCommands
//
// All commands that your add-in adds to DevStudio
// must appear in this interface. You may use the
// ClassView to add methods to this interface, which
// will cause stub implementations of those methods to
// appear in your CCommands class.
[ uuid(713F3DEE-713A-4CE7-9B44-822829A28986),
oleautomation,
dual
]
interface ICommands : IDispatch
{
// methods
[id(1)]
HRESULT QuiteCommandMethod();
[id(2), helpstring("method QuitVCIDE")] HRESULT QuitVCIDE();
};
// Class information for CCommands
[ uuid(840B0262-7AED-4E38-9B66-97BD1C05E464) ]
coclass Commands
{
[default] interface ICommands;
};
[ hidden, uuid(73F268AA-6EA0-472F-9625-392C1A10518C) ]
coclass ApplicationEvents
{
[default] interface IApplicationEvents;
}
[ hidden, uuid(74635E9A-9073-4036-A9DD-70C04613A874) ]
coclass DebuggerEvents
{
[default] interface IDebuggerEvents;
}
//{{AFX_APPEND_ODL}}
//}}AFX_APPEND_ODL}}
};
这是本来 方法里的代码
下面是我加的
但是总有一处错误
STDMETHODIMP CCommands::QuitVCIDE()
{
AFX_MANAGE_STATE(AfxGetStaticNoduleState())
VERIFY_OK(m_pApplication->EnableModeless(VARIANT_FAlSE));
if(MessageBox(NULL,"确实要退出VC开发环境么?","提示",MB_YESNO)==IDyes)
m_pApplication->Quit();
VERIFY_OK(m_pApplication->EnableModeless(VARIANT_TRUE));
return S_OK;
}