std::map compiler stack overflow when DLL 
Author Message
 std::map compiler stack overflow when DLL

Compiling below code using MS VC++ 6.0 SP3 (or SP4) is OK as long as
compiler switches are set for compiling to a (multi threaded debug)
console .exe file.

Trying to compile the same code using switches to generate a multi
threaded debug DLL the compiler gives an error stating stack overflow.
Has anyone experienced something similiar? Can someone give me an
advice how to circumvent this?

TIA

Peter

-------------------------------------

....

#include <map>
#include <string>

typedef       std::map< std::string,  
                        CPHDataItemFactorySingleIFC*,
                        std::less< std::string >
                      >
              TDataItemFactorySingleIFCByStringIdMap;

typedef       std::map< int,
                        CPHDataItemFactorySingleIFC*,
                        std::less<int>
                      >    
              TDataItemFactorySingleIFCByIntIdMap;

class CPHDataItemFactory
{
   public:
      CPHDataItemFactory();

      virtual RWCollectable *MakeCollectable(
                         CPHDataItem *pClsCollDataItem );

      virtual CPHDataItem   *MakeDataItem(
                         RWCollectable *pClsCollDataItem );

      virtual CPHDataItem    *Create( CPHDataItem *item );

      void    AddFactory( CPHDataItemFactorySingleIFC &factory,
                          int nTypeId,
                          const char *szTypeStr )
      {
          m_factoryByIntId.insert(
TDataItemFactorySingleIFCByIntIdMap::value_type( nTypeId, &factory ));  

          m_factoryByStringId.insert(
TDataItemFactorySingleIFCByStringIdMap::value_type(
std::string(szTypeStr), &factory ));

          return;
      };

    protected:

    private:
      TDataItemFactorySingleIFCByStringIdMap   m_factoryByStringId;
      TDataItemFactorySingleIFCByIntIdMap  m_factoryByIntId;

Quote:
};



Fri, 21 Feb 2003 04:43:53 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Passing std::set and std::map objects between 2 dlls

2. MSC compiler stack overflow

3. fm20.dll stack overflow when resizing ATL 7.0 ActiveX control

4. OLEVIEW Stack overflow in ADVAPI32.DLL

5. Stack overflow in COMCTL32.DLL

6. My program crashes in W98 (Stack Overflow in Kernel32.dll)

7. Stack overflow in COMCTL32.DLL

8. Stack Structure and Stack Overflow for CE

9. Exporting STL containers (specifically std::map) from DLL?

10. std::map.find() crashing in DLL

11. MFC Extension DLL and std::map

12. mem leaks when using std::map in a dll

 

 
Powered by phpBB® Forum Software