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. problem in InitInstance

problem in InitInstance

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 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.
  • G Offline
    G Offline
    Gerald Mercet
    wrote on last edited by
    #1

    Hi everybody I don't understand why this morning when i tried to start my dialog based application, the message box has opened with the following message: Uhandled exception in Fractal_v1_0.exe:0xC000005: Access Violation So i've found that this problem comes from the following line of code in the function InitInstance: m_pMainWnd=&Dlg; The big problem is that my application used to run before, so is anybody could explain me where could this problem come? Thanks in advance gerald

    I 1 Reply Last reply
    0
    • G Gerald Mercet

      Hi everybody I don't understand why this morning when i tried to start my dialog based application, the message box has opened with the following message: Uhandled exception in Fractal_v1_0.exe:0xC000005: Access Violation So i've found that this problem comes from the following line of code in the function InitInstance: m_pMainWnd=&Dlg; The big problem is that my application used to run before, so is anybody could explain me where could this problem come? Thanks in advance gerald

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      Have you added any controls to the dialog which would cause CreateDialog to fail? You can add "no fail create" style (in the more styles box) to your dialog and see if any bits of it don't appear or cause your OnInitDialog / DoDataExchange functions to die. Good luck, Iain.

      G 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        Have you added any controls to the dialog which would cause CreateDialog to fail? You can add "no fail create" style (in the more styles box) to your dialog and see if any bits of it don't appear or cause your OnInitDialog / DoDataExchange functions to die. Good luck, Iain.

        G Offline
        G Offline
        Gerald Mercet
        wrote on last edited by
        #3

        For your first question i answer : yes I'm sorry, but i'm not sure to understand exactly what you mean by adding "no fail create" style how could i do that?

        I 1 Reply Last reply
        0
        • G Gerald Mercet

          For your first question i answer : yes I'm sorry, but i'm not sure to understand exactly what you mean by adding "no fail create" style how could i do that?

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          Open the relevant dialog in VC++. Select the dialog itself. Press return and bring up the options box. One of the tabs at the top of the options box says "More styles". One if the checkboxes there says "no fail create". This sets a style flags telling windows not to fail on CreateDialog even if it can't create a part of the dialog box. OK? Iain.

          G 1 Reply Last reply
          0
          • I Iain Clarke Warrior Programmer

            Open the relevant dialog in VC++. Select the dialog itself. Press return and bring up the options box. One of the tabs at the top of the options box says "More styles". One if the checkboxes there says "no fail create". This sets a style flags telling windows not to fail on CreateDialog even if it can't create a part of the dialog box. OK? Iain.

            G Offline
            G Offline
            Gerald Mercet
            wrote on last edited by
            #5

            Your method works if i choose Win32 Release mode for debugging my application, but with debug mode it doesn't work anymore, why?

            I 1 Reply Last reply
            0
            • G Gerald Mercet

              Your method works if i choose Win32 Release mode for debugging my application, but with debug mode it doesn't work anymore, why?

              I Offline
              I Offline
              Iain Clarke Warrior Programmer
              wrote on last edited by
              #6

              I don't know exactly why, but there is an obvious place to start. In debug mode, newly allocated memory is filled with CC in each byte. In Release, it is filled with 00 in each byte. So you may have a variable that you have not explicitly initialised, but Release sets it to 0 / NULL. Maybe you've missed a DDX_Control? You'll need to put breakpoints in your dialogs constructor, OnInitDialog, etc and see where it dies in more detail. If you are really stuck, email me your project, and I'll have a look see. Iain.

              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