为什么网上的一些代码例子却传递了俩个参数,这是为什么? // Give the browser a pointer to my IOleClientSite object
 if (!browserObject->lpVtbl->SetClientSite(browserObject, (IOleClientSite *)_iOleClientSiteEx))
 {
   // We can now call the browser object's SetHostNames function. SetHostNames lets the browser object know our
   // application's name and the name of the document in which we're embedding the browser. (Since we have no
   // document name, we'll pass a 0 for the latter). When the browser object is opened for editing, it displays
   // these names in its titlebar.
....
....

解决方案 »

  1.   

    https://svn.origo.ethz.ch/eiffelstudio/branches/eth/eve/Src/library/web_browser/spec/include/ole_ie.c
      

  2.   

    人家应该是用的c语言写的,对于由于c没有类没有this指针,所以你看IOleObject的接口定义
    第一个参数相当于this指针,第二个参数跟原来那唯一一个参数是一样的。。
    #if defined(__cplusplus) && !defined(CINTERFACE)
        
        
    #else  /* C style interface */  //就是这儿    typedef struct IOleObjectVtbl
        {
            BEGIN_INTERFACE
            
            HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
                IOleObject * This,
                /* [in] */ __RPC__in REFIID riid,
                /* [iid_is][out] */ 
                __RPC__deref_out  void **ppvObject);
            
            ULONG ( STDMETHODCALLTYPE *AddRef )( 
                IOleObject * This);
            
            ULONG ( STDMETHODCALLTYPE *Release )( 
                IOleObject * This);
            
            HRESULT ( STDMETHODCALLTYPE *SetClientSite )( 
                IOleObject * This,
                /* [unique][in] */ __RPC__in_opt IOleClientSite *pClientSite);
                
            END_INTERFACE
        } IOleObjectVtbl;    interface IOleObject
        {
            CONST_VTBL struct IOleObjectVtbl *lpVtbl;
        };