Click here to Skip to main content
16,004,227 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionthread-safe private variable Pin
Nick Alexeev28-Dec-06 13:48
professionalNick Alexeev28-Dec-06 13:48 
AnswerRe: thread-safe private variable Pin
Mark Salsbery28-Dec-06 14:59
Mark Salsbery28-Dec-06 14:59 
GeneralRe: thread-safe private variable Pin
Nick Alexeev28-Dec-06 17:32
professionalNick Alexeev28-Dec-06 17:32 
GeneralRe: thread-safe private variable Pin
Blake Miller2-Jan-07 11:11
Blake Miller2-Jan-07 11:11 
Questionhow to make a linux game Pin
active6628-Dec-06 13:23
active6628-Dec-06 13:23 
AnswerRe: how to make a linux game Pin
ThatsAlok28-Dec-06 23:14
ThatsAlok28-Dec-06 23:14 
QuestionHow to create a window in general? Pin
Jethro6328-Dec-06 10:09
Jethro6328-Dec-06 10:09 
AnswerRe: How to create a window in general? [modified] Pin
Mark Salsbery28-Dec-06 11:24
Mark Salsbery28-Dec-06 11:24 
MFC windows are created in two steps - one for the C++ CWnd object and one for the Windows HWND.
// step 1
CWnd *pWnd = new CWnd();
// step 2  
pWnd->Create(NULL, _T("Window Name"), WS_CHILD|WS_VISIBLE|WS_OVERLAPPEDWINDOW, CRect(10,10,100,100), 
                pParentWnd, ID_CHILDWND, NULL);

If you want the window to do something useful you'll probably want to derive your own window class
from CWnd.
If you want to use extended window styles you can use the CreateEx() method.

Destruction of windows is generally two steps as well (CFrameWnd-derived windows are an
exception).
// step 1
pWnd->DestroyWindow();
// step 2  
delete pWnd;




-- modified at 17:48 Thursday 28th December, 2006
Changed the WS_ styles.
AnswerRe: How to create a window in general? Pin
Mark Salsbery28-Dec-06 11:47
Mark Salsbery28-Dec-06 11:47 
GeneralRe: How to create a window in general? Pin
Jethro6328-Dec-06 13:32
Jethro6328-Dec-06 13:32 
GeneralRe: How to create a window in general? Pin
Mark Salsbery28-Dec-06 13:40
Mark Salsbery28-Dec-06 13:40 
GeneralRe: How to create a window in general? Pin
Jethro6328-Dec-06 13:59
Jethro6328-Dec-06 13:59 
GeneralRe: How to create a window in general? Pin
Mark Salsbery28-Dec-06 14:19
Mark Salsbery28-Dec-06 14:19 
GeneralRe: How to create a window in general? Pin
Jethro6328-Dec-06 14:27
Jethro6328-Dec-06 14:27 
GeneralRe: How to create a window in general? Pin
Mark Salsbery28-Dec-06 14:33
Mark Salsbery28-Dec-06 14:33 
GeneralRe: How to create a window in general? Pin
Mark Salsbery28-Dec-06 14:38
Mark Salsbery28-Dec-06 14:38 
GeneralRe: How to create a window in general? Pin
Jethro6328-Dec-06 14:45
Jethro6328-Dec-06 14:45 
GeneralRe: How to create a window in general? Pin
prasad_som28-Dec-06 19:41
prasad_som28-Dec-06 19:41 
GeneralRe: How to create a window in general? Pin
Jethro6329-Dec-06 3:20
Jethro6329-Dec-06 3:20 
AnswerRe: How to create a window in general? Pin
prasad_som29-Dec-06 7:02
prasad_som29-Dec-06 7:02 
GeneralRe: How to create a window in general? Pin
prasad_som29-Dec-06 7:08
prasad_som29-Dec-06 7:08 
Questionoctal GUID convertion to string Pin
vga228-Dec-06 6:43
vga228-Dec-06 6:43 
AnswerRe: octal GUID convertion to string Pin
Michael Dunn28-Dec-06 7:15
sitebuilderMichael Dunn28-Dec-06 7:15 
GeneralRe: octal GUID convertion to string Pin
vga229-Dec-06 2:49
vga229-Dec-06 2:49 
QuestionBizarre printf behaviour Pin
Ed.Poore28-Dec-06 6:12
Ed.Poore28-Dec-06 6:12 

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.