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. OnInitDialog called in Release, but not in Debug!

OnInitDialog called in Release, but not in Debug!

Scheduled Pinned Locked Moved C / C++ / MFC
announcementdebuggingquestion
4 Posts 3 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.
  • J Offline
    J Offline
    Jonnie White
    wrote on last edited by
    #1

    I've inherited a class CMyPrintDialog from CPrintDialog, and it's initialisation happens in OnInitDialog(). OnInitDialog is only called in the release version. In the debug version, the dialog remains uninitialised! Does anyone know why? Thanks Jonnie

    A S 2 Replies Last reply
    0
    • J Jonnie White

      I've inherited a class CMyPrintDialog from CPrintDialog, and it's initialisation happens in OnInitDialog(). OnInitDialog is only called in the release version. In the debug version, the dialog remains uninitialised! Does anyone know why? Thanks Jonnie

      A Offline
      A Offline
      Alvaro Mendez
      wrote on last edited by
      #2

      Woah, you mean that if you put a breakpoint inside the OnInitDialog function, it never stops there? The only possible explanation is that it's using another class. Check and make sure you don't already have a class with the same name defined somewhere else. I got bitten by this problem a long time ago -- redefining a class somewhere else with the same name. I don't remember why the compiler or linker never caught it, but it drove me nuts for a long time before I discovered it. Regards, Alvaro

      1 Reply Last reply
      0
      • J Jonnie White

        I've inherited a class CMyPrintDialog from CPrintDialog, and it's initialisation happens in OnInitDialog(). OnInitDialog is only called in the release version. In the debug version, the dialog remains uninitialised! Does anyone know why? Thanks Jonnie

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #3

        I've run into this problem in the past; it appears to be either a bug in some versions of MFC, or small version differences: debug EXEs compiled (and working) on one developer's machine would fail to work on another. Installing the latest service pack fixed it for me. You might also try just re-installing the version you have (if you don't have access to the latest service pack, or have a slow internet connection for instance), but i can't say whether this will have any effect or not. farewell goodnight last one out turn out the lights

        Smashing Pumpkins, Tales of a Scorched Earth

        J 1 Reply Last reply
        0
        • S Shog9 0

          I've run into this problem in the past; it appears to be either a bug in some versions of MFC, or small version differences: debug EXEs compiled (and working) on one developer's machine would fail to work on another. Installing the latest service pack fixed it for me. You might also try just re-installing the version you have (if you don't have access to the latest service pack, or have a slow internet connection for instance), but i can't say whether this will have any effect or not. farewell goodnight last one out turn out the lights

          Smashing Pumpkins, Tales of a Scorched Earth

          J Offline
          J Offline
          Jonnie White
          wrote on last edited by
          #4

          Thanks for your help. It was an MFC bug fixed in the Visual Studio 6.0 Service Pack 1. Works like a dream now. Jonnie

          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