📄 foo.h
字号:
// Foo.h : Declaration of the CFoo
#pragma once
#include "resource.h" // main symbols
// IFoo
[
object,
uuid("C06D95D1-708A-4768-9E14-2B29923EBADD"),
dual, helpstring("IFoo Interface"),
pointer_default(unique)
]
__interface IFoo : IDispatch
{
[id(1), helpstring("method Something")] HRESULT Something(void);
};
// IGoo
[
object,
uuid("DB3C94F8-5C8D-4aec-93EC-526DB67CD1F8"),
dual, helpstring("IGoo Interface"),
pointer_default(unique)
]
__interface IGoo : IDispatch
{
[id(1), helpstring("method Banana")] HRESULT Banana(void);
};
// CFoo
[
coclass,
threading("apartment"),
vi_progid("SimpleServer.Foo"),
progid("SimpleServer.Foo.1"),
version(1.0),
uuid("A1F1E7D9-1C00-468F-898A-054AE9EF76AB"),
helpstring("Foo Class")
]
class ATL_NO_VTABLE CFoo :
public IFoo,
public IGoo
{
public:
CFoo()
{
}
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHOD(Something)(void);
// IGoo Methods
public:
STDMETHOD(Banana)()
{
// Add your function implementation here. MessageBox(0, "Banana", "Msg", 0); return S_OK;
}
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -