Category : atl

I have a COM DLL "XPLib.dll" that I need to call functions from. I’m trying to use ATL::CComPtr but I don’t know where to get the information required. I don’t have any headers or documentation, just a dll. So far I’m doing this ATL::CComPtr<IXPLibVacSystemControl> pVac; hr = pVac.CoCreateInstance("CLSID_IXPLibVacSystemControl") As I’ve seen others do online, but ..

Read more

Am using CreateWindow() API which was working correctly on VS2015 before upgrading to VS2019. After upgrading to VS2015 CreateWindow API is returning null HWND.Calling AtlAxWinInit() before CreateWindow() API as shown below. CreateControl() { AtlAxWinInit(); HWND hwndChild = CreateWindow(_T("AtlAxWin"), _T("test"), WS_CHILD|WS_VISIBLE, 0,0,0,0, hwnd,NULL, ::GetModuleHandle(NULL), NULL); } GetLastError() is returning 1407 error code which is ERROR_CANNOT_FIND_WND_CLASS :Cannot ..

Read more

I have an old c++ shared library project that successfully compiled on vs2007 but fails to specific header files i have on the system. (afxdlgs.h and afxdisp.h) screenshot specific code segment I have installed all the needed visual studio compoments screenshot of vs installer And selected the installed platform components in the properties tab screenshot ..

Read more

Is there a strategy for safely allowing an ATL object to release itself in response to a Windows message or sink event? In other words, let’s say you have an ATL class that’s subclassing some windows (using a message map) and/or sinking events from COM objects (using a sink map). And you’d like the class ..

Read more

I have a class "data" containing a CString (CStringT). "data" is a member of another class and is frequently reassigned by value. The initial assignment works fine, however the second makes the application crash, although both objects have valid data. The callstack also compares two valid strings, however at some point in this process it ..

Read more