Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: UnmanagedToManaged Bridge called from unmanaged DLL Pin
Jose Viveiros15-Dec-06 5:24
Jose Viveiros15-Dec-06 5:24 
GeneralRe: UnmanagedToManaged Bridge called from unmanaged DLL Pin
Mark Salsbery15-Dec-06 6:05
Mark Salsbery15-Dec-06 6:05 
GeneralRe: UnmanagedToManaged Bridge called from unmanaged DLL Pin
Jose Viveiros15-Dec-06 6:21
Jose Viveiros15-Dec-06 6:21 
GeneralRe: UnmanagedToManaged Bridge called from unmanaged DLL Pin
Mark Salsbery15-Dec-06 6:33
Mark Salsbery15-Dec-06 6:33 
GeneralRe: UnmanagedToManaged Bridge called from unmanaged DLL Pin
Jose Viveiros15-Dec-06 6:48
Jose Viveiros15-Dec-06 6:48 
GeneralRe: UnmanagedToManaged Bridge called from unmanaged DLL Pin
Mark Salsbery15-Dec-06 7:41
Mark Salsbery15-Dec-06 7:41 
GeneralRe: UnmanagedToManaged Bridge called from unmanaged DLL Pin
Jose Viveiros15-Dec-06 8:36
Jose Viveiros15-Dec-06 8:36 
QuestionMemory management Pin
BlitzPackage14-Dec-06 7:54
BlitzPackage14-Dec-06 7:54 
Greetings,

Let's say I do this:

vector<cmyclass *=""> m_vMyVector;

void SomeFunction(CString strID, bool bStatus)
{
CMyClass * pMyObj = new CMyClass(strID, bStatus);
m_vMyVector.push_back(pMyObj);
pMyObj = NULL;
}

Let's say SomeFunction(...) is in a loop and I create several of these objects. When I call m_vMyVector.clear() will there be a memory leak? In essence, I want to know if I have to go back and call delete on each of the elements in m_vMyVector or will the memory be freed once I call the vector's "clear" method or once the vector is destroyed when the class containing it is destroyed. Also, once I add pMyObj to the vector and reassign the one in the function to point to null, the vector still retains its own valid pointers to the objects in memory, correct?

Thanks for any help or insight you can provide.

Sincerely,
BP
AnswerRe: Memory management Pin
Maximilien14-Dec-06 8:12
Maximilien14-Dec-06 8:12 
GeneralRe: Memory management Pin
BlitzPackage14-Dec-06 8:15
BlitzPackage14-Dec-06 8:15 
GeneralRe: Memory management Pin
peterchen14-Dec-06 13:11
peterchen14-Dec-06 13:11 
GeneralRe: Memory management Pin
peterchen14-Dec-06 13:12
peterchen14-Dec-06 13:12 
GeneralRe: Memory management Pin
BlitzPackage14-Dec-06 13:31
BlitzPackage14-Dec-06 13:31 
GeneralRe: Memory management Pin
peterchen14-Dec-06 14:31
peterchen14-Dec-06 14:31 
GeneralRe: Memory management Pin
Maximilien14-Dec-06 14:15
Maximilien14-Dec-06 14:15 
QuestionMFC printing Pin
Milos Djokovic14-Dec-06 6:29
Milos Djokovic14-Dec-06 6:29 
QuestionHow i can create Toolbar in my application?? Pin
Shah Satish14-Dec-06 4:36
Shah Satish14-Dec-06 4:36 
AnswerRe: How i can create Toolbar in my application?? Pin
Mark Salsbery14-Dec-06 6:15
Mark Salsbery14-Dec-06 6:15 
AnswerRe: How i can create Toolbar in my application?? Pin
Hamid_RT14-Dec-06 18:18
Hamid_RT14-Dec-06 18:18 
QuestionChanging Network property programmatically in C++ [modified] Pin
IlyaCher14-Dec-06 4:27
IlyaCher14-Dec-06 4:27 
QuestionError Pin
Alex_Y14-Dec-06 4:24
Alex_Y14-Dec-06 4:24 
AnswerRe: Error Pin
Alex_Y14-Dec-06 5:28
Alex_Y14-Dec-06 5:28 
GeneralRe: Error Pin
toxcct14-Dec-06 6:20
toxcct14-Dec-06 6:20 
GeneralRe: Error Pin
Alex_Y14-Dec-06 7:47
Alex_Y14-Dec-06 7:47 
QuestionComboBox problem Pin
Like2Byte14-Dec-06 3:38
Like2Byte14-Dec-06 3:38 

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.