webbrowser控件和CHtmlView打开页面有什么区别?
现在有一个页面用CHtmlView打开没什么问题,但是用webbrowser打开的时候,页面上的按钮点击没有反应,很奇怪的问题。
[解决办法]
CHtmlView调的是IE,你的浏览器是IE否?
[解决办法]
chtmlview=cfromview+iwebbrowser
[解决办法]
http://msdn.microsoft.com/zh-cn/library/system.windows.forms.webbrowser(v=vs.80).aspx
[解决办法]
struct __declspec(uuid("eab22ac1-30c1-11cf-a7eb-0000c05bae0b"))IWebBrowser : IDispatch{ // // Property data // __declspec(property(get=GetApplication)) IDispatchPtr Application; __declspec(property(get=GetParent)) IDispatchPtr Parent; __declspec(property(get=GetContainer)) IDispatchPtr Container; __declspec(property(get=GetDocument)) IDispatchPtr Document; __declspec(property(get=GetTopLevelContainer)) VARIANT_BOOL TopLevelContainer; __declspec(property(get=GetType)) _bstr_t Type; __declspec(property(get=GetLeft,put=PutLeft)) long Left; __declspec(property(get=GetTop,put=PutTop)) long Top; __declspec(property(get=GetWidth,put=PutWidth)) long Width; __declspec(property(get=GetHeight,put=PutHeight)) long Height; __declspec(property(get=GetLocationName)) _bstr_t LocationName; __declspec(property(get=GetLocationURL)) _bstr_t LocationURL; __declspec(property(get=GetBusy)) VARIANT_BOOL Busy; // // Wrapper methods for error-handling // HRESULT GoBack ( ); HRESULT GoForward ( ); HRESULT GoHome ( ); HRESULT GoSearch ( ); HRESULT Navigate ( _bstr_t URL, VARIANT * Flags = &vtMissing, VARIANT * TargetFrameName = &vtMissing, VARIANT * PostData = &vtMissing, VARIANT * Headers = &vtMissing ); HRESULT Refresh ( ); HRESULT Refresh2 ( VARIANT * Level = &vtMissing ); HRESULT Stop ( ); IDispatchPtr GetApplication ( ); IDispatchPtr GetParent ( ); IDispatchPtr GetContainer ( ); IDispatchPtr GetDocument ( ); VARIANT_BOOL GetTopLevelContainer ( ); _bstr_t GetType ( ); long GetLeft ( ); void PutLeft ( long pl ); long GetTop ( ); void PutTop ( long pl ); long GetWidth ( ); void PutWidth ( long pl ); long GetHeight ( ); void PutHeight ( long pl ); _bstr_t GetLocationName ( ); _bstr_t GetLocationURL ( ); VARIANT_BOOL GetBusy ( ); // // Raw methods provided by interface // virtual HRESULT __stdcall raw_GoBack ( ) = 0; virtual HRESULT __stdcall raw_GoForward ( ) = 0; virtual HRESULT __stdcall raw_GoHome ( ) = 0; virtual HRESULT __stdcall raw_GoSearch ( ) = 0; virtual HRESULT __stdcall raw_Navigate ( BSTR URL, VARIANT * Flags = &vtMissing, VARIANT * TargetFrameName = &vtMissing, VARIANT * PostData = &vtMissing, VARIANT * Headers = &vtMissing ) = 0; virtual HRESULT __stdcall raw_Refresh ( ) = 0; virtual HRESULT __stdcall raw_Refresh2 ( VARIANT * Level = &vtMissing ) = 0; virtual HRESULT __stdcall raw_Stop ( ) = 0; virtual HRESULT __stdcall get_Application ( IDispatch * * ppDisp ) = 0; virtual HRESULT __stdcall get_Parent ( IDispatch * * ppDisp ) = 0; virtual HRESULT __stdcall get_Container ( IDispatch * * ppDisp ) = 0; virtual HRESULT __stdcall get_Document ( IDispatch * * ppDisp ) = 0; virtual HRESULT __stdcall get_TopLevelContainer ( VARIANT_BOOL * pBool ) = 0; virtual HRESULT __stdcall get_Type ( BSTR * Type ) = 0; virtual HRESULT __stdcall get_Left ( long * pl ) = 0; virtual HRESULT __stdcall put_Left ( long pl ) = 0; virtual HRESULT __stdcall get_Top ( long * pl ) = 0; virtual HRESULT __stdcall put_Top ( long pl ) = 0; virtual HRESULT __stdcall get_Width ( long * pl ) = 0; virtual HRESULT __stdcall put_Width ( long pl ) = 0; virtual HRESULT __stdcall get_Height ( long * pl ) = 0; virtual HRESULT __stdcall put_Height ( long pl ) = 0; virtual HRESULT __stdcall get_LocationName ( BSTR * LocationName ) = 0; virtual HRESULT __stdcall get_LocationURL ( BSTR * LocationURL ) = 0; virtual HRESULT __stdcall get_Busy ( VARIANT_BOOL * pBool ) = 0;};
[解决办法]
只能说是你的方法有问题。
http://www.codeproject.com/KB/miscctrl/webapp.aspx