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

C / C++ / MFC

 
QuestionReturn Hooked Values Pin
stevelam23-Aug-06 23:17
stevelam23-Aug-06 23:17 
QuestionRe: Return Hooked Values Pin
prasad_som24-Aug-06 0:11
prasad_som24-Aug-06 0:11 
QuestionRe: Return Hooked Values Pin
David Crow24-Aug-06 2:47
David Crow24-Aug-06 2:47 
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 
I am learning Win32API programming. I do not use MFC. Now I have created a class which creates a Window of the Static class. Lets call the class CStatic. This class creates a Static Window and has all the functionalities that a normal Static control has. My problem begins when I use the class.

As long as I use the class like CStatic m_Static there is no problem but when I create an instance of the class using CStatic* m_pStatic = new CStatic(), I start running into confusions. Isn't it necessary to use delete m_pStatic to remove the object from memory or will m_pStatic->DestroyWindow() do the same thing?

When I try
m_pStatic->DestroyWindow()
delete m_pStatic
I get an error? Does the object get removed if I simply use the DestroyWindow() function? The DestroyWindow() function in turn just calls the WIN32API DestroyWindow().

From what I reason, CStatic* m_pStatic = new CStatic() creates an object of CStatic in memory and m_pStatic->Create() in turn creates another object for the Window. So I have two objects in memory, one of my class and one belonging to the Window. Am I right? or is my whole concept wrong? If I am correct then a call to DestroyWindow should only delete the Window object and not the object of my class. Isn't it? Then now come when I try to delete m_pStatic after a call to Destroywindow, it throws an exception.

Can anyone explain.


---
Beer | [beer] Hakuna-Matada Beer | [beer]
It means no worries for the rest of your days...
It's our problem free, Philosophy

<marquee behavior="alternate" scrollamount="5" scrolldelay="50">Jig | [Dance]

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 
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 

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.