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. When debugging from VS it works, when running from explorer not

When debugging from VS it works, when running from explorer not

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelpvisual-studiocomwindows-admin
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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I am having this strange issue that I cant trace because my program works just fine when debugging from within VS or any other debugger (I tried olly as well), but whenever I run it from the explorer it doesnt work completly. I am reading values from the registry using this Wrapper. Then Im assigning the value of the key to a variable like this: char * binaryData = (char *)value.operator LPCTSTR(); Then I'm converting the char from UTF8 to Unicode, but there should not be a problem. However, the resulting string has in the most cases something appended like "=C:\Pr " which looks like a string to me but I have no idea how it got appended to the registry value. The strange thing now is that whenever I debug it with VS it works, but when I run it normally from windows it puts those strange characters at the end of the strings. Btw, my strings are in REG_BINARY format. Does anyone know what the problem here is? Thanks, lucki_luke

    M 1 Reply Last reply
    0
    • L Lost User

      Hi, I am having this strange issue that I cant trace because my program works just fine when debugging from within VS or any other debugger (I tried olly as well), but whenever I run it from the explorer it doesnt work completly. I am reading values from the registry using this Wrapper. Then Im assigning the value of the key to a variable like this: char * binaryData = (char *)value.operator LPCTSTR(); Then I'm converting the char from UTF8 to Unicode, but there should not be a problem. However, the resulting string has in the most cases something appended like "=C:\Pr " which looks like a string to me but I have no idea how it got appended to the registry value. The strange thing now is that whenever I debug it with VS it works, but when I run it normally from windows it puts those strange characters at the end of the strings. Btw, my strings are in REG_BINARY format. Does anyone know what the problem here is? Thanks, lucki_luke

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

      try running from VS without debugger (ctrl-f5?) i think problem must be with env and/or project settings. we faced one similar problem where the error occurred only in release mode. we had to change some 3rd party libraries as far as i remember.

      ---------------------- Mayank Thakore Learning C++ - since 1998 They didn't print my card right; so I resigned.

      L 1 Reply Last reply
      0
      • M MayankT

        try running from VS without debugger (ctrl-f5?) i think problem must be with env and/or project settings. we faced one similar problem where the error occurred only in release mode. we had to change some 3rd party libraries as far as i remember.

        ---------------------- Mayank Thakore Learning C++ - since 1998 They didn't print my card right; so I resigned.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        When running from VS without debugger it doesnt work either, and as I said before it works even when running from OllyDbg. And Debug or Release mode doesnt matter as it works in both modes with debugger and not without... I have totally no idea what to do...

        B 1 Reply Last reply
        0
        • L Lost User

          When running from VS without debugger it doesnt work either, and as I said before it works even when running from OllyDbg. And Debug or Release mode doesnt matter as it works in both modes with debugger and not without... I have totally no idea what to do...

          B Offline
          B Offline
          Blake Miller
          wrote on last edited by
          #4

          Check for variables that are not initialized. Debugger mode (or debug build) will initialize variables with some non-zero data, while release mode might contain random data or zeros. That is usually the difference.

          Any sufficiently gross incompetence is nearly indistinguishable from malice.

          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