CWebBrowser2 (MFC) GoBack method causing crash when has nothing to gobck

  c++, internet-explorer, mfc

My application supports the IE(InternetExplorer) browser. When the back/forward buttons are clicked and there is nothing to go back or forward
Webbrowser.GoBack() or Webbrowser.GoForward() is causing a crash.

Is there any way to know if I can GoBack in MFC/C++ before I actually call GoBack()? I took a look at C++ CWebBrowser2 class functions, I couldn’t find any as such.

Is there any API to help on this or any alternative approach to handle this?

Source: Windows Questions C++