Click here to Skip to main content
15,916,288 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CTreeCtrl Speeding issue Pin
Vikram Kashyap19-Oct-04 18:39
Vikram Kashyap19-Oct-04 18:39 
GeneralRe: CTreeCtrl Speeding issue Pin
Joel Lucsy19-Oct-04 15:37
Joel Lucsy19-Oct-04 15:37 
Generallooking for a specific c++ object Pin
Vacnez19-Oct-04 3:27
Vacnez19-Oct-04 3:27 
GeneralCListCtrl Navigation Pin
Manoj Singh K.19-Oct-04 3:16
Manoj Singh K.19-Oct-04 3:16 
GeneralWho wrote this CString class Pin
rromerot19-Oct-04 1:53
rromerot19-Oct-04 1:53 
GeneralRe: Who wrote this CString class Pin
Antony M Kancidrowski19-Oct-04 2:17
Antony M Kancidrowski19-Oct-04 2:17 
GeneralRe: Who wrote this CString class Pin
Chris Meech19-Oct-04 2:36
Chris Meech19-Oct-04 2:36 
GeneralRe: Who wrote this CString class Pin
rromerot19-Oct-04 4:20
rromerot19-Oct-04 4:20 
The implementation of class is within the definition and non are inline. It uses malloc and free and I am finding out that the Format function does not work if there was no data in the string before use. Whoever wrote this probably has already fixed it. Following is part of the class.

class CString
{
// Members
protected:
char *m_str;

// Constructor/Destructor
public:
CString()
{
m_str = NULL;
}
CString(char *szInputSource)
{
m_str = NULL;
if (szInputSource)
Copy(szInputSource);
}
CString(const CString &szInputSource)
{
m_str = NULL;
Copy(szInputSource.GetData());
}
~CString()
{
Empty();
}

// Methods
public:
void Empty()
{
if (m_str)
{
free( m_str );
m_str = NULL;
}
}
void Format(LPSTR pszFormat, ...) // do not use, m_str does not have the right buffer allocated
{ // missing here is a preliminary loop that sums the amount of bytes required to expand pszFormat according to argList %s, %d, ...
va_list argList;
va_start(argList, pszFormat);
vsprintf(m_str, pszFormat, argList );
va_end(argList);
}

Ray
GeneralRe: Who wrote this CString class Pin
RobJones19-Oct-04 4:57
RobJones19-Oct-04 4:57 
GeneralPlease explain code! Pin
Brakanjan19-Oct-04 1:07
Brakanjan19-Oct-04 1:07 
GeneralRe: Please explain code! Pin
Cedric Moonen19-Oct-04 1:42
Cedric Moonen19-Oct-04 1:42 
GeneralRe: Please explain code! Pin
benjymous19-Oct-04 1:48
benjymous19-Oct-04 1:48 
GeneralRe: Please explain code! Pin
Brakanjan19-Oct-04 3:33
Brakanjan19-Oct-04 3:33 
GeneralRe: Please explain code! Pin
Henry miller19-Oct-04 3:21
Henry miller19-Oct-04 3:21 
GeneralRe: Please explain code! Pin
Brakanjan19-Oct-04 3:42
Brakanjan19-Oct-04 3:42 
GeneralRe: Please explain code! Pin
Cedric Moonen19-Oct-04 4:16
Cedric Moonen19-Oct-04 4:16 
GeneralRe: Please explain code! Pin
Brakanjan19-Oct-04 4:36
Brakanjan19-Oct-04 4:36 
GeneralRe: Please explain code! Pin
Cedric Moonen19-Oct-04 4:41
Cedric Moonen19-Oct-04 4:41 
GeneralGeneral Dialog Size Question Pin
sweep12318-Oct-04 23:58
sweep12318-Oct-04 23:58 
GeneralRe: General Dialog Size Question Pin
Maximilien19-Oct-04 0:44
Maximilien19-Oct-04 0:44 
GeneralRe: General Dialog Size Question Pin
sweep12319-Oct-04 1:07
sweep12319-Oct-04 1:07 
GeneralRe: General Dialog Size Question Pin
benjymous19-Oct-04 1:52
benjymous19-Oct-04 1:52 
GeneralRe: General Dialog Size Question Pin
Vikram Kashyap19-Oct-04 2:05
Vikram Kashyap19-Oct-04 2:05 
GeneralRe: General Dialog Size Question Pin
David Crow19-Oct-04 2:33
David Crow19-Oct-04 2:33 
QuestionGet the x and y pixelsize of the screen? Pin
anderslundsgard18-Oct-04 23:54
anderslundsgard18-Oct-04 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.