1

我想创建一个没有 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文件。谷歌之后,我找到了这个链接

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

4

0 回答 0