Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Creating a new window

Creating a new window

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpdebuggingperformancetutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FrankMichael
    wrote on last edited by
    #1

    Hi, I am learning VC++ with some experience with C++, I could compile and execute some simple programs like finding a prime etc successfully. Now I am trying to learn creating a new window using MFC. Whenever I execute the code, i get the following message" "Hello.exe has encounetered a problem and needs to close..please tell Microsoft about the problem...." The appname and modname in the technical data are both Hello.exe. When I click on the Debug button in this window it gives me the following message "The instruction at "Ox0045c8fb" referenced memorry at "0x00000000". The memory could not be "read". Clik ok to terminate the program." In the Debug information I have: Loaded 'C:\WINDOWS\system32\ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL' Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL' Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\SHLWAPI.DLL', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\apphelp.dll', no matching symbolic information found. The thread 0x9F0 has exited with code 0 (0x0). The thread 0x9C4 has exited with code -1073741819 (0xC0000005). The code I am trying to execute is: // Creating a Hello.cpp win 32 application. #include class C_MyApp:public CWinApp { BOOL InitInstance(); }; class C_MainFrame:public CFrameWnd { public: C_MainFrame(); }; C_MainFrame::C_MainFrame() { Create(NULL,"Main Window"); } BOOL C_MyApp::InitInstance() { m_pMainWnd=new C_MainFrame(); m_pMainWnd->ShowWindow(m_nCmdShow); return TRUE; } void main() { //int m_pCmdShow; C_MyApp myApp; } Can anyone help me on how to successfully execute this program? Thanks in Advance, Regards, Frank Michael, "Faith is a great stimulant so is Fear"

    M 1 Reply Last reply
    0
    • F FrankMichael

      Hi, I am learning VC++ with some experience with C++, I could compile and execute some simple programs like finding a prime etc successfully. Now I am trying to learn creating a new window using MFC. Whenever I execute the code, i get the following message" "Hello.exe has encounetered a problem and needs to close..please tell Microsoft about the problem...." The appname and modname in the technical data are both Hello.exe. When I click on the Debug button in this window it gives me the following message "The instruction at "Ox0045c8fb" referenced memorry at "0x00000000". The memory could not be "read". Clik ok to terminate the program." In the Debug information I have: Loaded 'C:\WINDOWS\system32\ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL' Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL' Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\SHLWAPI.DLL', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\apphelp.dll', no matching symbolic information found. The thread 0x9F0 has exited with code 0 (0x0). The thread 0x9C4 has exited with code -1073741819 (0xC0000005). The code I am trying to execute is: // Creating a Hello.cpp win 32 application. #include class C_MyApp:public CWinApp { BOOL InitInstance(); }; class C_MainFrame:public CFrameWnd { public: C_MainFrame(); }; C_MainFrame::C_MainFrame() { Create(NULL,"Main Window"); } BOOL C_MyApp::InitInstance() { m_pMainWnd=new C_MainFrame(); m_pMainWnd->ShowWindow(m_nCmdShow); return TRUE; } void main() { //int m_pCmdShow; C_MyApp myApp; } Can anyone help me on how to successfully execute this program? Thanks in Advance, Regards, Frank Michael, "Faith is a great stimulant so is Fear"

      M Offline
      M Offline
      Mad__
      wrote on last edited by
      #2

      Try crate simple SDI project using AppWizard and see deference with you code ;) You forget many ...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups