在没有tlb文件的情况下创建ITypeInfo对象

时间:2013-06-17 08:42:56

标签: visual-c++ com idispatch typelib

我想创建一个没有tlb文件的ITypeInfo对象。

class CExternalHelperM:public IDispatch,public IDocHostUIHandler
{
public:
CExternalHelperM();
virtual ~CExternalHelperM();

BEGIN_JSOBJECT_MAP()
    JSOBJECT_MAP(L"config",CConfigObject)
    JSOBJECT_MAP(L"sqlite",CSqliteObject)
    JSOBJECT_MAP(L"filesystem",CFileSystemObject)
END_JSOBJECT_MAP()

int SetExternal(IUnknown* pUnknow);

STDMETHOD(ShowContextMenu)( DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved );
STDMETHOD(GetHostInfo)( DOCHOSTUIINFO *pInfo );
STDMETHOD(ShowUI)( DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc );
STDMETHOD(HideUI)( void );
STDMETHOD(UpdateUI)( void );
STDMETHOD(EnableModeless)( BOOL fEnable );
STDMETHOD(OnDocWindowActivate)( BOOL fActivate );
STDMETHOD(OnFrameWindowActivate)( BOOL fActivate );
STDMETHOD(ResizeBorder)( LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow );
STDMETHOD(TranslateAccelerator)( LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID );
STDMETHOD(GetOptionKeyPath)( LPOLESTR *pchKey, DWORD dw );
STDMETHOD(GetDropTarget)( IDropTarget *pDropTarget, IDropTarget **ppDropTarget );
STDMETHOD(GetExternal)( IDispatch **ppDispatch );
STDMETHOD(TranslateUrl)( DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut );
STDMETHOD(FilterDataObject)( IDataObject *pDO, IDataObject **ppDORet );
STDMETHOD(QueryInterface)( REFIID riid, void **ppvObject );

STDMETHOD(GetTypeInfoCount)( UINT *pctinfo);
STDMETHOD(GetTypeInfo)( UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo );
STDMETHOD(GetIDsOfNames)( REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId );
STDMETHOD(Invoke)( DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr );

virtual ULONG STDMETHODCALLTYPE AddRef( void );
virtual ULONG STDMETHODCALLTYPE Release( void );
private:
LONG                m_cRef;
BOOL                m_bEnableMenu;
};

我想实现方法GetTypeInfo,所以我需要返回一个ITypeInfo指针,但我没有tlb文件。 谷歌之后,我找到了这个link

我需要有关如何在没有tlb文件的情况下创建ITypeInfo对象的更多信息。 “METHOD0”,“METHOD1”未定义。

0 个答案:

没有答案