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. string value in watch window

string value in watch window

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestion
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.
  • H Offline
    H Offline
    Hugo Hallman
    wrote on last edited by
    #1

    I have a structure like struct Id { LPCSTR sId; /* note that this is the first member */ unsigned nId; }; I'd LOVE to have vc-debugger to display the sId value (in place of {...}) in the watch/this/locals/auto window, like CString does. I've looked through the sources for CString and haven't quite figured it out. Deriving from string isn't an option. Any suggestions?

    M D 2 Replies Last reply
    0
    • H Hugo Hallman

      I have a structure like struct Id { LPCSTR sId; /* note that this is the first member */ unsigned nId; }; I'd LOVE to have vc-debugger to display the sId value (in place of {...}) in the watch/this/locals/auto window, like CString does. I've looked through the sources for CString and haven't quite figured it out. Deriving from string isn't an option. Any suggestions?

      M Offline
      M Offline
      Martyn Pearson
      wrote on last edited by
      #2

      Locate the file autoexp.dat - mine (Visual Studio 6) is in the MSDev98\bin directory. This file contains details of the expansions used when debugging. Open this up, and there is a huge bit at the top telling you how to do your own stuff. Further down you can see the entry for CString. Hope this helps!

      1 Reply Last reply
      0
      • H Hugo Hallman

        I have a structure like struct Id { LPCSTR sId; /* note that this is the first member */ unsigned nId; }; I'd LOVE to have vc-debugger to display the sId value (in place of {...}) in the watch/this/locals/auto window, like CString does. I've looked through the sources for CString and haven't quite figured it out. Deriving from string isn't an option. Any suggestions?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Are you saying that when you view Id.sId in the watch window, it shows ellipses instead of the actual data? If you do not know about the autoexp.dat file, and thus have never altered it, then I'm unclear on your question. By default, the contents of the address pointed to by Id.sId are displayed. If you had just Id in the watch window, it would indeed show up as {...}.

        H 1 Reply Last reply
        0
        • D David Crow

          Are you saying that when you view Id.sId in the watch window, it shows ellipses instead of the actual data? If you do not know about the autoexp.dat file, and thus have never altered it, then I'm unclear on your question. By default, the contents of the address pointed to by Id.sId are displayed. If you had just Id in the watch window, it would indeed show up as {...}.

          H Offline
          H Offline
          Hugo Hallman
          wrote on last edited by
          #4

          thanks a lot. I didn't know of autoexp.dat, but have always suspected something like it. Thank you very much for telling me of it. (Thought it was built into vstudio. -darn M$)

          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