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. ATL / WTL / STL
  4. Project Runtime Library Option

Project Runtime Library Option

Scheduled Pinned Locked Moved ATL / WTL / STL
helpai-codingdebuggingquestionannouncement
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.
  • A Offline
    A Offline
    ajitatif angajetor
    wrote on last edited by
    #1

    Hi everyone, I'm working on an IE toolbar.Everything went fine until i had to add a dialog box of some kind of user setting.Dialog opens,does its work and closes just fine on my development computer,but on other computers it does not.The button which is supposed to open the dialog does nothing.After some try-and-error experience,I found out that the problem was Runtime Library setting under Code Generation section of the project properties dialog. Whenever i select a Non-Debug runtime library,the dll built does not work on other systems.When I select a Debug runtime library (like Multi-threaded Debug (/MTD) or Multi-threaded Debug DLL (/MDd)) it builds and works out fine.But it also doubles the dll file size and much likely with debug information which is unnecessary in the release build. Has anyone any idea what the case might be?

    M 1 Reply Last reply
    0
    • A ajitatif angajetor

      Hi everyone, I'm working on an IE toolbar.Everything went fine until i had to add a dialog box of some kind of user setting.Dialog opens,does its work and closes just fine on my development computer,but on other computers it does not.The button which is supposed to open the dialog does nothing.After some try-and-error experience,I found out that the problem was Runtime Library setting under Code Generation section of the project properties dialog. Whenever i select a Non-Debug runtime library,the dll built does not work on other systems.When I select a Debug runtime library (like Multi-threaded Debug (/MTD) or Multi-threaded Debug DLL (/MDd)) it builds and works out fine.But it also doubles the dll file size and much likely with debug information which is unnecessary in the release build. Has anyone any idea what the case might be?

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      I always use the multithreaded CRT, which is staticly linked into the DLL. That way it will (or should) work on any machine regardless of what CRT DLLs are installed.

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

      A 1 Reply Last reply
      0
      • M Michael Dunn

        I always use the multithreaded CRT, which is staticly linked into the DLL. That way it will (or should) work on any machine regardless of what CRT DLLs are installed.

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        A Offline
        A Offline
        ajitatif angajetor
        wrote on last edited by
        #3

        Thanks for the response, I digged up the code a little bit further and found out the problem was an uninitialized HWND value. something like; HWND hwndWB2; // the "guilt" m_spWebBrowser2->get_HWND((SHANDLE_PTR *)&hwndWB2)); ... ... MyDialog dialog = MyDialog(); dialog.DoModal(hwndWB2); When the guilt line is modified as: HWND hwndWB2 = NULL; everything's OK. but the reason why it works with Debug CRT is still a curiosity.

        S 1 Reply Last reply
        0
        • A ajitatif angajetor

          Thanks for the response, I digged up the code a little bit further and found out the problem was an uninitialized HWND value. something like; HWND hwndWB2; // the "guilt" m_spWebBrowser2->get_HWND((SHANDLE_PTR *)&hwndWB2)); ... ... MyDialog dialog = MyDialog(); dialog.DoModal(hwndWB2); When the guilt line is modified as: HWND hwndWB2 = NULL; everything's OK. but the reason why it works with Debug CRT is still a curiosity.

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          It's probably more that it's compiled with run-time checks on (/RTC1 flag) - the compiler can put in extra code when compiling to help find problems like overwriting bits of the stack or heap you shouldn't do. This requires stack/heap to be initialised to known values, which it does (it actually sets them to 0xcccccccc). These values are probably recognisable as invalid by DoModal (or IsWindow, or something), so it just rejects them. In Release, the HWND isn't initialised at all, so may contain a value that *could* be a valid HWND, causing the crash?

          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