[ object,
uuid(FC3B3F61-BCEC-11D1-91FE-E1CBED988F66)
]
interface IStack : IUnknown
{
import "unknwn.idl";
HRESULT Push([in] long value);
HRESULT Pop([out, retval] long* pVal);
HRESULT Empty([out, retval] boolean* pVal);
};
the mapping c++ code:
#include "wtypes.h"
/* {FC3B3F61-BCEC-11D1-91FE-E1CBED988F66} */
DEFINE_GUID(IID_IStack,
0xFC3B3F61, 0xBCEC, 0x11D1, 0x91, 0xFE,
0xE1, 0xCB, 0xED, 0x98, 0x8F, 0x66);
class IStack : public IUnknown {
public:
virtual HRESULT Push(long value) = 0;
virtual HRESULT Pop(long* value) = 0;
virtual HRESULT Empty(long* flag) = 0;
};
or
#include "wtypes.h"
/* {FC3B3F61-BCEC-11D1-91FE-E1CBED988F66} */
DEFINE_GUID(IID_IStack,
0xFC3B3F61, 0xBCEC, 0x11D1, 0x91, 0xFE,
0xE1, 0xCB, 0xED, 0x98, 0x8F, 0x66);
DECLARE_INTERFACE_(IStack, IUnknown)
{
// *** IStack methods *** //
STDMETHOD(Push) (THIS_ long value) PURE;
STDMETHOD(Pop) (THIS_ long* value) PURE;
STDMETHOD(Empty) (THIS_ long* flag) PURE;
};
沒有留言:
張貼留言