
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:
};