Safe, High performance, reuseable

Monday, June 26, 2006

!InlineIsEqualGUID(*m_plibid, GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?"

Description:
I downloaded and placed WTL 7 into VC.NET.
I used the ATL/WTL Appwizrd to create a simple dialog-based WTL program, and I marked 'Enable ActivX Control Hosting'I marked 'Generate .CPP files'and I tried the whole thing with 'Create a COM Server' and without.
I then added this article's .h file to my project, included it in stdafx.h.
I then declared a member variable 'CWTLIExplorer m_pBrowser;' in my dialog class.
once a button is pushed, I called this code :
m_pBrowser.Create( m_hWnd, rcDefault, _T("about:blank"), WS_HSCROLL WS_VSCROLL WS_CHILD WS_VISIBLE WS_CLIPSIBLINGS WS_CLIPCHILDREN ); m_pBrowser->Navigate(_bstr_t("http://www.codeproject.com"),NULL,NULL,NULL,NULL);
The thing is, that when the 'Create' function is called, I get an assertion that says :
!InlineIsEqualGUID(*m_plibid, GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?"
Anybody know what this means ?
All i want is to embed IWebBrowser2 in an atl or wtl program, and i want it to be as simple as possible... this class looks so nice nad simple, but I can't manage to use it, what's my mistake ?

Solution:
The assert is only related to a slight API change between earlier ATL and ATL7.
To get it to work, just use this :_Module.Init(NULL, hInstance, &LIBID_ATLLib);instead of :_Module.Init(NULL, hInstance);

No comments: