Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Return Hooked Values Pin
stevelam24-Aug-06 3:56
stevelam24-Aug-06 3:56 
QuestionWhat is the best way to close a application Pin
NorGUI23-Aug-06 23:15
NorGUI23-Aug-06 23:15 
AnswerRe: What is the best way to close a application Pin
uday kiran janaswamy23-Aug-06 23:18
uday kiran janaswamy23-Aug-06 23:18 
AnswerRe: What is the best way to close a application Pin
Michael Dunn24-Aug-06 0:15
sitebuilderMichael Dunn24-Aug-06 0:15 
QuestionControl wrapper Pin
HakunaMatada23-Aug-06 23:14
HakunaMatada23-Aug-06 23:14 
AnswerRe: Control wrapper Pin
Cedric Moonen23-Aug-06 23:33
Cedric Moonen23-Aug-06 23:33 
GeneralRe: Control wrapper Pin
HakunaMatada24-Aug-06 0:44
HakunaMatada24-Aug-06 0:44 
GeneralRe: Control wrapper Pin
Cedric Moonen24-Aug-06 1:22
Cedric Moonen24-Aug-06 1:22 
As I can see by your code, m_pStatic is not a member of any class and its scope is probably limited to the function where it has been declared. Am I right or is your code different ?
In that case, you will lose track of your pointer and won't be able to delete it anymore (resulting in a memory leak).

I have some suggestions:
1) first, instead of forcing the user to call DestroyWindow from your control, why don't you simply put it in the destructor of your class ? So like that it will be called automatically when your class is destroyed.
2) try to avoid using dynamic allocation when it is not necessary (like in this case, you don't really need to allocate the control dynamically, I am right ?)
3) make all your controls member of the class in which they are used. This way, they will be destroyed when the parent class is destroyed and you don't need to have some headache because they are going out of scope whe nyou don't want (remember that when it goes out of scope, the object is destroyed and so its destructor is also called).

Hope this helps


Cédric Moonen
Software developer

Charting control [Updated - v1.1]

QuestionSample CMap Application Pin
velayudhan_raj23-Aug-06 22:43
velayudhan_raj23-Aug-06 22:43 
AnswerRe: Sample CMap Application Pin
Christian Graus23-Aug-06 22:47
protectorChristian Graus23-Aug-06 22:47 
AnswerRe: Sample CMap Application Pin
uday kiran janaswamy23-Aug-06 23:48
uday kiran janaswamy23-Aug-06 23:48 
AnswerRe: Sample CMap Application Pin
David Crow24-Aug-06 2:57
David Crow24-Aug-06 2:57 
QuestionShowing Statusbar in Windows Explorer Pin
Jagadeesh VN23-Aug-06 22:29
Jagadeesh VN23-Aug-06 22:29 
GeneralRe: Showing Statusbar in Windows Explorer Pin
prasad_som24-Aug-06 0:17
prasad_som24-Aug-06 0:17 
Questionnetworking [modified] Pin
ramanand_bulusu23-Aug-06 22:11
ramanand_bulusu23-Aug-06 22:11 
AnswerRe: networking Pin
toxcct23-Aug-06 22:24
toxcct23-Aug-06 22:24 
QuestionRe: networking [modified] Pin
ramanand_bulusu23-Aug-06 22:36
ramanand_bulusu23-Aug-06 22:36 
GeneralRe: networking Pin
toxcct23-Aug-06 22:38
toxcct23-Aug-06 22:38 
AnswerRe: networking Pin
_AnsHUMAN_ 23-Aug-06 22:26
_AnsHUMAN_ 23-Aug-06 22:26 
AnswerRe: networking Pin
Hamid_RT24-Aug-06 0:09
Hamid_RT24-Aug-06 0:09 
QuestionAbout Combobox Pin
vijay_aroli23-Aug-06 22:09
vijay_aroli23-Aug-06 22:09 
AnswerRe: About Combobox Pin
_AnsHUMAN_ 23-Aug-06 22:22
_AnsHUMAN_ 23-Aug-06 22:22 
AnswerRe: About Combobox Pin
yummi23-Aug-06 22:26
yummi23-Aug-06 22:26 
GeneralRe: About Combobox Pin
vijay_aroli23-Aug-06 22:49
vijay_aroli23-Aug-06 22:49 
GeneralRe: About Combobox Pin
uday kiran janaswamy23-Aug-06 23:25
uday kiran janaswamy23-Aug-06 23:25 

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.