COM-Objects containing maps / content error(0)

Posted by Florian Berzsenyi on Stack Overflow See other posts from Stack Overflow or by Florian Berzsenyi
Published on 2010-12-26T13:48:41Z Indexed on 2010/12/26 13:54 UTC
Read the original article Hit count: 278

Filed under:
|
|
|
|

I'm writing a small wrapper to get familiar with some important topics in C++ (WinAPI, COM, STL,OOP). For now, my class shall be able to create a (child) window. Mainly, this window is connected to a global message loop that distribute messages to a local loop of the right instance (global is static, local is virtual).

Obviously, there are surely better ways to do that but I'm using std::maps to store HWND and their instance pointer in pairs (the Global loop looks for the pointer with the HWND-parameter, gets itself the pointer from the map and calls then the local loop).

Now, it appears that the map does not accept any values because of a unknown reason. It seems to allocate enough space but something went wrong anyway [ (error) 0 is displayed instead of the entries in visual C++).

I've looked that up in google as well and found out that maps cause some trouble when used in classes AND DLLs. May this be the reason and is there any solution??

Protected scope of class: static std::map<HWND,MAP_BASE_OBJECT*> m_LoopBuf

Implementation in .cpp-file: std::map<HWND,MAP_BASE_OBJECT*> HWindow::m_LoopBuf;

© Stack Overflow or respective owner

Related posts about c++

Related posts about dll