Click here to Skip to main content
15,914,014 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Hi Mark:

Sure, here it is:

<br />
CRuntimeClass*	pRTC;<br />
pRTC = RUNTIME_CLASS( COneView );<br />
pWindow = (CWnd *)pRTC->CreateObject( ) ;<br />
pWindow->Create( (LPCTSTR)m_strTypeOneView, <br />
                  TEXT("One Little View"), <br />
                  WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW, <br />
                  CRect(0, 0, 400, 300), this, 4567 );<br />


The "mstrTypeOneView" string contains the result returned from an earlier call to
AfxRegisterWndClass:

<br />
try<br />
{<br />
	m_strTypeOneView = AfxRegisterWndClass(<br />
		0,<br />
		::LoadCursor(NULL, IDC_CROSS),<br />
		(HBRUSH)reinterpret_cast<HBRUSH>(COLOR_BACKGROUND+1),<br />
		::LoadIcon(NULL, IDI_APPLICATION));<br />
}<br />
catch (CResourceException* pEx)<br />
{<br />
	AfxMessageBox(_T("Couldn't register class! (Already registered?)"));<br />
	pEx->Delete();<br />
}<br />


I'm sure that the window registration is working because I have made alterations to the background color and the ICON and the window responds as expected.

Thanks,
Mark
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 
AnswerRe: Bizarre printf behaviour Pin
David Crow28-Dec-06 6:29
David Crow28-Dec-06 6:29 
GeneralRe: Bizarre printf behaviour Pin
Ed.Poore28-Dec-06 6:57
Ed.Poore28-Dec-06 6:57 
AnswerRe: Bizarre printf behaviour Pin
Mark Salsbery28-Dec-06 7:10
Mark Salsbery28-Dec-06 7:10 
GeneralRe: Bizarre printf behaviour Pin
Ed.Poore28-Dec-06 7:28
Ed.Poore28-Dec-06 7:28 

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.