Click here to Skip to main content
15,917,631 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralODBC and C++ Pin
SuzannaS23-Jun-04 0:09
SuzannaS23-Jun-04 0:09 
GeneralRe: ODBC and C++ Pin
Sumit Kapoor23-Jun-04 1:50
Sumit Kapoor23-Jun-04 1:50 
GeneralRe: ODBC and C++ Pin
basementman23-Jun-04 5:34
basementman23-Jun-04 5:34 
GeneralStrange problem with CString Pin
rrrado22-Jun-04 23:43
rrrado22-Jun-04 23:43 
GeneralRe: Strange problem with CString Pin
David Crow23-Jun-04 4:07
David Crow23-Jun-04 4:07 
GeneralRe: Strange problem with CString Pin
rrrado23-Jun-04 4:31
rrrado23-Jun-04 4:31 
GeneralRe: Strange problem with CString Pin
rrrado23-Jun-04 4:49
rrrado23-Jun-04 4:49 
GeneralRe: Strange problem with CString Pin
David Crow23-Jun-04 4:59
David Crow23-Jun-04 4:59 
I assume you typed these code snippets in rather than copying/pasting them directory from your project. I had to make some changes just to get them to compile. Smile | :) Here is what I have that produces no errors:

class CAaa
{
    CString m_str; 
public:
    CAaa();
    ~CAaa();
    void Set();
};
 
void CAaa::Set()
{  
    CString tmp;
    m_str = tmp;
}
 
typedef CArray<CAaa *, CAaa *> CAaaArray;
 
class anotherClass
{  
    CAaaArray m_array;
    
public:
    anotherClass();
    ~anotherClass()
    {
        CAaa *aaa;
        for (int i = 0; i < m_array.GetSize(); i++)
        {
            aaa = m_array.GetAt(i);
            delete aaa;
        }
    }
 
    void SomeFunc();  
    void add();
};
 
void anotherClass::add()
{   
    CAaa *aaa = new CAaa;
    m_array.Add(aaa);
}
 
void anotherClass::SomeFunc()
{   
    CAaa *aaa;   
    for (int i = 0; i < m_array.GetSize(); i++)   
    {     
        aaa = m_array.GetAt(i);
        aaa->Set();   
    }
}
... 
anotherClass ac;
ac.add();
ac.SomeFunc();
How does it compare to what you have?


"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


GeneralRe: Strange problem with CString Pin
rrrado23-Jun-04 5:33
rrrado23-Jun-04 5:33 
GeneralRe: Strange problem with CString Pin
rrrado23-Jun-04 5:57
rrrado23-Jun-04 5:57 
GeneralRe: Strange problem with CString Pin
jmkhael23-Jun-04 6:58
jmkhael23-Jun-04 6:58 
GeneralRe: Strange problem with CString Pin
Ravi Bhavnani23-Jun-04 7:06
professionalRavi Bhavnani23-Jun-04 7:06 
GeneralRe: Strange problem with CString Pin
jmkhael23-Jun-04 7:08
jmkhael23-Jun-04 7:08 
GeneralRe: Strange problem with CString Pin
David Crow23-Jun-04 7:11
David Crow23-Jun-04 7:11 
GeneralRe: Strange problem with CString Pin
jmkhael23-Jun-04 7:13
jmkhael23-Jun-04 7:13 
GeneralRe: Strange problem with CString Pin
David Crow23-Jun-04 7:07
David Crow23-Jun-04 7:07 
GeneralRe: Strange problem with CString Pin
rrrado23-Jun-04 20:57
rrrado23-Jun-04 20:57 
GeneralC++ STL help... using pointer in STL map Pin
Indrawati22-Jun-04 23:36
Indrawati22-Jun-04 23:36 
GeneralRe: C++ STL help... using pointer in STL map Pin
Johnny ²23-Jun-04 3:09
Johnny ²23-Jun-04 3:09 
GeneralRe: C++ STL help... using pointer in STL map Pin
Anonymous23-Jun-04 14:20
Anonymous23-Jun-04 14:20 
QuestionHow to Enable/Disable the hibernation support in VC++ Pin
ErisonWu22-Jun-04 21:57
ErisonWu22-Jun-04 21:57 
GeneralChange cursor in a region of a CStatic Pin
doctorpi22-Jun-04 21:52
doctorpi22-Jun-04 21:52 
GeneralRe: Change cursor in a region of a CStatic Pin
Johan Rosengren22-Jun-04 22:21
Johan Rosengren22-Jun-04 22:21 
Questionhow to find all folders which are shared fully in my drive??? Pin
ngocdq22-Jun-04 21:34
ngocdq22-Jun-04 21:34 
AnswerRe: how to find all folders which are shared fully in my drive??? Pin
shri_3120-Sep-04 3:26
shri_3120-Sep-04 3:26 

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.