J
Joe
I have a situation where the wrong constructor is being called. I
have defined 2 constructors with different parameter types that are
defined as follows...
class __declspec(dllexport)CColumn : public CColumnBase
{
public:
CColumn(CString columnType,CObject *aOwner, CString anId);
CColumn(CString columnType,CObject *aOwner, bool batchUpdated);
....
}
The implementation of these functions looks like this...
CColumn::CColumn(CString columnType, CObject *aOwner, CString anId)
{
setColumnType(columnType);
setOwner(aOwner);
setId(anId);
setLength(10);
setPrecision(5);
setField();
setBatchUpdated(false);
}
CColumn::CColumn(CString columnType, CObject *aOwner, bool
batchUpdated)
{
setColumnType(columnType);
setOwner(aOwner);
setId("");
setLength(10);
setPrecision(5);
setField();
setBatchUpdated(batchUpdated);
}
When the line below in the CDual() constructor gets called, the
constructor with the signature of CColumn::CColumn(CString columnType,
CObject *aOwner, bool batchUpdated) gets invoked, rather than the one
I want.
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE( CDual, CDomain )
CDual::CDual()
{
...
addColumn(new CColumn(TIMESTAMP_COLUMN,this,"TIMESTAMP"));
...
}
Does anyone have any idea why this is happening and how to avoid this
issue?
Thanks,
Joe
have defined 2 constructors with different parameter types that are
defined as follows...
class __declspec(dllexport)CColumn : public CColumnBase
{
public:
CColumn(CString columnType,CObject *aOwner, CString anId);
CColumn(CString columnType,CObject *aOwner, bool batchUpdated);
....
}
The implementation of these functions looks like this...
CColumn::CColumn(CString columnType, CObject *aOwner, CString anId)
{
setColumnType(columnType);
setOwner(aOwner);
setId(anId);
setLength(10);
setPrecision(5);
setField();
setBatchUpdated(false);
}
CColumn::CColumn(CString columnType, CObject *aOwner, bool
batchUpdated)
{
setColumnType(columnType);
setOwner(aOwner);
setId("");
setLength(10);
setPrecision(5);
setField();
setBatchUpdated(batchUpdated);
}
When the line below in the CDual() constructor gets called, the
constructor with the signature of CColumn::CColumn(CString columnType,
CObject *aOwner, bool batchUpdated) gets invoked, rather than the one
I want.
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE( CDual, CDomain )
CDual::CDual()
{
...
addColumn(new CColumn(TIMESTAMP_COLUMN,this,"TIMESTAMP"));
...
}
Does anyone have any idea why this is happening and how to avoid this
issue?
Thanks,
Joe