Posted on 2000-04-03
I have an object which has 2 constructors. One is a default and the other one accepts parameters. The default constructor calls the other one with the appropriate parametrs. The problem is that after calling the other constructors, which initializes some member data items, the member data items get overwritten by some junk values, as if they where not initialized in the first place.
Below is a code segment:
// Get the document
CTheDoc *pDoc = (CTheDoc*)((CFrameWnd*) AfxGetMainWnd())->GetActiveDocument();
CString strName, strIdent;
CAirportFileBuilder ((char*)((LPCTSTR) strName), (char*)((LPCTSTR) strIdent));
CAirportFileBuilder::CAirportFileBuilder (char *szName, char *sIdent)
// Set the file version
m_Hdr.iFileVersion = AIRPORT_FILE_VERSION;
// Set the airport name
strncpy (m_Hdr.szName, szName, NAME_LENGTH-1);
strncpy (m_Hdr.szName, "Airport", NAME_LENGTH-1);
//....................... more initializations
Please advise on how to make this chain call to do what I want it to do.