Thread: Creating a Dialog Based Application without MFC

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Since you are using the dialog as your main window then you could just use a modal dialog and avoid create a message loop with the DialogBox macro.

  2. #2
    Registered User
    Join Date
    May 2005
    Posts
    28
    Quote Originally Posted by Quantum1024
    Since you are using the dialog as your main window then you could just use a modal dialog and avoid create a message loop with the DialogBox macro.
    Blah, its been a long day. Thank you Quantum, of course I could do that. Revised code would look something like this for future reference:

    Code:
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
    {
    	return DialogBox(hInstance, MAKEINTRESOURCE(IDD_CALC), NULL, CalcProc);
    }
    I think... I didn't look up the API but I think the CreateDialog and DialogBox functions have the same parameters. But what they do is quite different

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MFC run application by clicking on file...
    By dug in forum Windows Programming
    Replies: 4
    Last Post: 12-02-2004, 04:33 AM
  2. MFC Save As dialog
    By Micko in forum Windows Programming
    Replies: 0
    Last Post: 08-23-2004, 02:02 PM
  3. problem with MFC application
    By Micko in forum Windows Programming
    Replies: 1
    Last Post: 07-12-2004, 05:36 PM
  4. Document Class and Dialog Windows :: MFC
    By kuphryn in forum Windows Programming
    Replies: 3
    Last Post: 12-01-2002, 12:27 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM