Board index » Visual Studio » Problem Hosting ActiveX Control
|
randyl
|
Problem Hosting ActiveX Control
Visual Studio125
Hi, I'm having trouble hosting an ActiveX control the way Microsoft recomends; I believe I may be doing something wrong... What I have is a Win32 C++ project, which is using the debug multithreaded libraries. I am including all the needed include files, have no compilation/build problems, and I keep receiving an error message complaining on the output window about not having enough storage space, just after CreateWindow() fails with error code 0x00000002 ("the system cannot find the file specified"). I am not linking with atl.lib. What annoies me is that there are some pointers on the Internet refering this problem, but are either outdated (Microsoft Knowledge Base Article - 192560: How To Add ATL Control Containment Support to Any Window, for example) or plain wrong. I suspect someone has already come across this... any ideas? ... #include <atlbase.h> #include <atlhost.h> ... HWND hParent = ...; //OK AtlAxWinInit(); //OK HWND h = ::CreateWindow(_T(ATLAXWIN_CLASS),_T("MSCAL.Calendar.7"),WS_CHILD | WS_VISIBLE | WS_BORDER,0,0,300,300,hParent,NULL,::GetModuleHandle(NULL),NULL); //Fails with error code 0x00000007 ::ShowWindow(hParent,SW_SHOW); //OK ::UpdateWindow(hParent); //OK ... I am using Visual Studio .NET 2003 and Windows XP Professional SP2. Any help would be much apreciated. Thanks very much in advance! Ricardo Peres PS - If possible, reply also to my e-mail address rjperes@sapo.pt - |
