Re: CreateWindowEx AtlAxWin fails with last error 1407
David Liebtag <DavidLiebtag@vermontel.net> wrote:
When I add these two lines the wnd.Create technique does not hit an
exception, but the calendar control is not visible in the child
container.
Works for me. Your WM_SIZE handler needed work (it referes to hWndX
variable that wasn't defined), but that fixed, I do see calendar control
in your test program.
The CreateWindow technique returns zero with last error also zero
when I use MSCAL.Calendar as the control class. When I use a URL, I
get a Debug Assertion Failed message box that asks me if I forgot to
pass LIBID to CComModule::Init.
Right, you need two more changes. First, call CoInitialize(0) somewhere
at the beginning of WinMain (and CoUninitialize at the end for
completeness). CAxWindow::Create happens to call it, so that's why it
works.
Second, change the module declaration to this:
class CDummyModule : public CAtlExeModuleT<CDummyModule> {
public:
DECLARE_LIBID(LIBID_ATLLib);
};
CDummyModule _Module;
With these changes, CreateWindow-based path works for me in your test,
both for Calendar and for WebBrowser.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925