473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

MFC code problem please help

100 100+
hi,
Expand|Select|Wrap|Line Numbers
  1. #include <afxwin.h>
  2.  
  3. class CExerciseApp : public CWinApp
  4. {
  5. public:
  6.     virtual BOOL InitInstance();
  7. };
  8.  
  9.  
  10.  
  11.  
  12. BOOL CExerciseApp::InitInstance()
  13. {
  14.     CDialog init;
  15.     init.Create(IDD_DIALOG1);
  16.     m_pMainWnd = new CMainFrame;
  17.     m_pMainWnd->ShowWindow(SW_NORMAL);
  18.  
  19.     return TRUE;
  20. }
  21.  
  22. CExerciseApp theApp;
  23.  
HEre is my code i just want to create a Dialog box...How?...pls help
Jun 14 '07 #1
2 1232
weaknessforcats
9,208 Expert Mod 8TB
Time to read "Programming Windows with MFC" by Jeff Prosise.

If memory serves, I think you need to call DoModal to display your box.
Jun 14 '07 #2
Assuming that you have created your dialog layout and plugged in the controls you want, you must show it.

1) Modal dialog box: by calling CDialog::DoModal, you leave the control of the application to that sole window, until you close it. It becomes the only window to capture events
2) Modeless dialog: you simply call CDialog::ShowWindow (CWnd::ShowWindow); you can pop up other dialogs around and they will be all elligible to receive inputs.

Hope this helps

hi,
Expand|Select|Wrap|Line Numbers
  1. #include <afxwin.h>
  2.  
  3. class CExerciseApp : public CWinApp
  4. {
  5. public:
  6.     virtual BOOL InitInstance();
  7. };
  8.  
  9.  
  10.  
  11.  
  12. BOOL CExerciseApp::InitInstance()
  13. {
  14.     CDialog init;
  15.     init.Create(IDD_DIALOG1);
  16.     m_pMainWnd = new CMainFrame;
  17.     m_pMainWnd->ShowWindow(SW_NORMAL);
  18.  
  19.     return TRUE;
  20. }
  21.  
  22. CExerciseApp theApp;
  23.  
HEre is my code i just want to create a Dialog box...How?...pls help
Jun 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
8
by: Zellan | last post by:
Hi All, Have added a Strconv function to the AfterUpdate event of a field to give me first letter capitalization (vbProperCase). I have added a msgbox that will allow me to over-ride where...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
1
SKJoy2001
by: SKJoy2001 | last post by:
PLEASE HELP ME!!! P E R L!!! I have a CGI (PERL) file namely 'test.cgi' and it has the correct permission (755) on the FTP server and it is within the CGI path. I have the following code in it:...
10
by: sara | last post by:
Hi - I have a report that is 14 columnar sub-reports (Line up: Position- holders in each of our 14 locations - Manager, Assistant Manager, Receiving, Office, etc). I output directly to PDF...
33
by: Adeel Hasan Akbari | last post by:
Hi! I'm new to this field. Actually i'm a new programmer. And i've never worked in C. It is my humble request to you to provide me with the source code for Spaceball (the game in which there's...
3
by: gmdune | last post by:
Hi All, I have written a program that doesn't seem to work and I can't figure out why it's not working. It compiles correctly, but when I run it I get prompted by the first couple of printf...
9
by: Chris Ahmsi | last post by:
I have been tasked to create a 'simple' form in Access providing managers to input necessary changes. I have 2 command buttons on the form and a check box. Command button 1 updates my table for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.