diff --git a/CefSharp.snk b/CefSharp.snk new file mode 100644 index 000000000..4cdf8ab57 Binary files /dev/null and b/CefSharp.snk differ diff --git a/CefSharp/BrowserControl.h b/CefSharp/BrowserControl.h index b64f3fe96..3937d3797 100644 --- a/CefSharp/BrowserControl.h +++ b/CefSharp/BrowserControl.h @@ -14,7 +14,7 @@ namespace CefSharp { interface class IBeforeResourceLoad; - public ref class BrowserControl sealed : public UserControl, INotifyPropertyChanged + public ref class BrowserControl sealed : public Control, INotifyPropertyChanged { bool _canGoForward; bool _canGoBack; diff --git a/CefSharp/CefSharp.vcproj b/CefSharp/CefSharp.vcproj index 4853d51d1..f5c5ae3d1 100644 --- a/CefSharp/CefSharp.vcproj +++ b/CefSharp/CefSharp.vcproj @@ -1,355 +1,351 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CefSharp/HandlerAdapter.h b/CefSharp/HandlerAdapter.h index 018b95cbc..4655bda11 100644 --- a/CefSharp/HandlerAdapter.h +++ b/CefSharp/HandlerAdapter.h @@ -14,6 +14,15 @@ namespace CefSharp HWND _browserHwnd; CefRefPtr _cefBrowser; + void ThrowIfCefBrowserIsNotReady() + { + if (_cefBrowser == nullptr) + { + //TODO: make own exception type? + throw gcnew InvalidOperationException("CefBrowser is not ready."); + } + } + protected: public: @@ -52,7 +61,11 @@ namespace CefSharp virtual RetVal HandleFindResult(CefRefPtr browser, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate) { return RV_CONTINUE; } HWND GetBrowserHwnd() { return _browserHwnd; } - CefRefPtr GetCefBrowser() { return _cefBrowser; } + CefRefPtr GetCefBrowser() + { + ThrowIfCefBrowserIsNotReady(); + return _cefBrowser; + } }; }; \ No newline at end of file