Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Need help (MFC)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 illuna   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 January 2000 - 09:52 AM

Okay I know my question sounds completly stupid but damn it I just can't create a stupid CButton!! *sorry guys* void CMainWnd::init() { /* Create the main window */ Create(NULL, "MainWindow", WS_OVERLAPPEDWINDOW, CRect(0,0,300,300), NULL, NULL); /* What's wrong with those 2 lines?? */ /* It compiles, doesn't make any errors, returns TRUE (function worked) but it doesn't display anything in the main window!! I also tried to to do a "ShowWindow()" on "test" but it do nothing either. Help!!*/ CButton test; test.Create("Test button", WS_CHILD/WS_VISIBLE, CRect(10,10,50,20), this, 1); } Thanks Illuna* Edited by - illuna on 1/5/00 3:55:55 PM Edited by - illuna on 1/5/00 3:56:20 PM

Sponsor:

#2 acw83   Members   -  Reputation: 174

Like
Likes
Like

Posted 05 January 2000 - 10:54 AM

To display your window you need to find the
BOOL CTheApp::InitInstance(); function and edit it to look like this:

BOOL CTheApp::InitInstance()
{
m_pMainWnd = new CMainWnd();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();

return TRUE;
}

#3 acw83   Members   -  Reputation: 174

Like
Likes
Like

Posted 05 January 2000 - 10:58 AM

Also, you need to put your call to Create in the function CMainWnd() (the constructor), not Init(); like this:

void CMainWnd::CMainWnd() {

/* Create the main window */
Create(NULL, "MainWindow", WS_OVERLAPPEDWINDOW, CRect(0,0,300,300), NULL,
NULL);

/* What''s wrong with those 2 lines?? */
/* It compiles, doesn''t make any errors, returns TRUE (function worked) but it doesn''t
display anything in the main window!! I also tried to to do a "ShowWindow()" on "test"
but it do nothing either. Help!!*/


CButton test;
test.Create("Test button", WS_CHILD/WS_VISIBLE, CRect(10,10,50,20), this, 1);

}

#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 07 January 2000 - 03:37 AM

Or you could just buy Visual C++ and it will be alot easier.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS