Click here to Skip to main content
15,895,772 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to save image from webBrowser Control Pin
voo doo1223-Jun-09 5:32
voo doo1223-Jun-09 5:32 
QuestionSetFont at Runtime Pin
p_196023-Jun-09 5:15
p_196023-Jun-09 5:15 
Questionhow to replace " with \" Pin
Ash_VCPP23-Jun-09 4:31
Ash_VCPP23-Jun-09 4:31 
AnswerRe: how to replace " with \" Pin
led mike23-Jun-09 4:37
led mike23-Jun-09 4:37 
AnswerRe: how to replace " with \" Pin
«_Superman_»23-Jun-09 4:54
professional«_Superman_»23-Jun-09 4:54 
QuestionMemory Leak Help Pin
OrangeV23-Jun-09 3:50
OrangeV23-Jun-09 3:50 
AnswerRe: Memory Leak Help Pin
«_Superman_»23-Jun-09 4:02
professional«_Superman_»23-Jun-09 4:02 
AnswerRe: Memory Leak Help Pin
Stuart Dootson23-Jun-09 4:20
professionalStuart Dootson23-Jun-09 4:20 
It all depends on what CreateObject actually does...

If it does something like this:

struct Object
{
   whatever
};

Object CreateObject() { return Object(); }


then you don't need to do anything to myObject before reassigning to it.

If it uses a resource allocating function (e.g. new and malloc allocate memory, CreateFile, CreateEvent and CreateProcess allocate kernel handles, there are many more different examples of resource allocators) and passes control of that resource back to you, then you are responsible for deallocating that resource.

To show a simple example:

Object* CreateObject() { return new Object(); }


To reassign to myObject, you'd need to deallocate the thing referenced by myObject using delete myObject

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

AnswerRe: Memory Leak Help Pin
Maximilien23-Jun-09 4:31
Maximilien23-Jun-09 4:31 
GeneralRe: Memory Leak Help Pin
OrangeV23-Jun-09 4:44
OrangeV23-Jun-09 4:44 
GeneralRe: Memory Leak Help Pin
Stuart Dootson23-Jun-09 5:31
professionalStuart Dootson23-Jun-09 5:31 
AnswerRe: Memory Leak Help Pin
Pavan_Putra25-Jun-09 20:00
Pavan_Putra25-Jun-09 20:00 
QuestionUnicode again Pin
bhanu_850923-Jun-09 3:39
bhanu_850923-Jun-09 3:39 
AnswerRe: Unicode again Pin
Code-o-mat23-Jun-09 4:04
Code-o-mat23-Jun-09 4:04 
QuestionShellExecute restriction? Pin
rp_suman23-Jun-09 3:07
rp_suman23-Jun-09 3:07 
QuestionRe: ShellExecute restriction? Pin
Rajesh R Subramanian23-Jun-09 3:11
professionalRajesh R Subramanian23-Jun-09 3:11 
QuestionRe: ShellExecute restriction? Pin
Roger Stoltz23-Jun-09 3:16
Roger Stoltz23-Jun-09 3:16 
AnswerRe: ShellExecute restriction? Pin
rp_suman23-Jun-09 3:30
rp_suman23-Jun-09 3:30 
AnswerRe: ShellExecute restriction? Pin
Rajesh R Subramanian24-Jun-09 20:35
professionalRajesh R Subramanian24-Jun-09 20:35 
AnswerRe: ShellExecute restriction? Pin
Rajesh R Subramanian23-Jun-09 3:30
professionalRajesh R Subramanian23-Jun-09 3:30 
AnswerRe: ShellExecute restriction? Pin
Rozis23-Jun-09 6:12
Rozis23-Jun-09 6:12 
QuestionNeed help on how to send SMS using VC++ program Pin
John50223-Jun-09 1:30
John50223-Jun-09 1:30 
AnswerRe: Need help on how to send SMS using VC++ program Pin
Hamid_RT23-Jun-09 1:50
Hamid_RT23-Jun-09 1:50 
Questionhow to get handle to a window Pin
B060611523-Jun-09 1:11
B060611523-Jun-09 1:11 
AnswerRe: how to get handle to a window Pin
Roger Stoltz23-Jun-09 1:22
Roger Stoltz23-Jun-09 1:22 

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.