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. Strange VC++ Debugger behavior

Strange VC++ Debugger behavior

Scheduled Pinned Locked Moved C / C++ / MFC
c++debuggingsharepointcomquestion
5 Posts 2 Posters 1 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
    Axonn Echysttas
    wrote on last edited by
    #1

    Hi : D. I'm running XP SP2 and Visual C++ 6 SP 6. I'm very curious about why this behavior occurs. If I call this function while I'm debugging, it works! ExitWindowsEx(EWX_POWEROFF, 0); But if I run the debug-built or even release-built executables from my hard disk, it does't work! Why!? This is very strange. From the debbuger, the computer starts shut down procedure, but otherwise, no way. Thank you...

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    A CPalliniC 2 Replies Last reply
    0
    • A Axonn Echysttas

      Hi : D. I'm running XP SP2 and Visual C++ 6 SP 6. I'm very curious about why this behavior occurs. If I call this function while I'm debugging, it works! ExitWindowsEx(EWX_POWEROFF, 0); But if I run the debug-built or even release-built executables from my hard disk, it does't work! Why!? This is very strange. From the debbuger, the computer starts shut down procedure, but otherwise, no way. Thank you...

      -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

      A Offline
      A Offline
      Axonn Echysttas
      wrote on last edited by
      #2

      Hm. Found my own answer in the meantime. Apparently, the VC++ IDE has administrator privileges. If you're a little program like me, check this out: http://msdn2.microsoft.com/en-us/library/aa376868.aspx (see SE_SHUTDOWN_NAME) http://msdn2.microsoft.com/en-us/library/aa375202.aspx ...and for a nice example... http://msdn2.microsoft.com/en-us/library/aa376871.aspx

      -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

      1 Reply Last reply
      0
      • A Axonn Echysttas

        Hi : D. I'm running XP SP2 and Visual C++ 6 SP 6. I'm very curious about why this behavior occurs. If I call this function while I'm debugging, it works! ExitWindowsEx(EWX_POWEROFF, 0); But if I run the debug-built or even release-built executables from my hard disk, it does't work! Why!? This is very strange. From the debbuger, the computer starts shut down procedure, but otherwise, no way. Thank you...

        -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Privileges, mon ami, privileges (I suppose...)! :-D MSDN [^] states To shut down or restart the system, the calling process must use the AdjustTokenPrivileges function to enable the SE_SHUTDOWN_NAME privilege. For more information, see Running with Special Privileges. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        In testa che avete, signor di Ceprano?

        A 1 Reply Last reply
        0
        • CPalliniC CPallini

          Privileges, mon ami, privileges (I suppose...)! :-D MSDN [^] states To shut down or restart the system, the calling process must use the AdjustTokenPrivileges function to enable the SE_SHUTDOWN_NAME privilege. For more information, see Running with Special Privileges. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          A Offline
          A Offline
          Axonn Echysttas
          wrote on last edited by
          #4

          We replied in the same time : D. Thank you anyway! Appreciated.

          -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

          CPalliniC 1 Reply Last reply
          0
          • A Axonn Echysttas

            We replied in the same time : D. Thank you anyway! Appreciated.

            -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            You hadn't to read the OP. :-D

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

            In testa che avete, signor di Ceprano?

            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