Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 278393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:13:52+00:00 2026-05-12T01:13:52+00:00

I am extending the Visual Studio 2003 debugger using autoexp.dat and a DLL to

  • 0

I am extending the Visual Studio 2003 debugger using autoexp.dat and a DLL to improve the way it displays data in the watch window. The main reason I am using a DLL rather than just the basic autoexp.dat functionality is that I want to be able to display things conditionally. e.g. I want to be able to say “If the name member is not an empty string, display name, otherwise display [some other member]”

I’m quite new to OOP and haven’t got any experience with the STL. So it might be that I’m missing the obvious.

I’m having trouble displaying vector members because I don’t know how to get the pointer to the memory the actual values are stored in.

Am I right in thinking the values are stored in a contiguous block of memory? And is there any way to get access to the pointer to that memory?

Thanks!

[edit:] To clarify my problem (I hope):

In my DLL, which is called by the debugger, I use a function called ReadDebuggeeMemory which makes a copy of the memory used by an object. It doesn’t copy the memory the object points to. So I need to know the actual address value of the internal pointer in order to be able to call ReadDebuggeeMemory on that as well. At the moment, the usual methods of getting the vector contents are returning garbage because that memory hasn’t been copied yet.

[update:]

I was getting garbage, even when I was looking at the correct pointer _Myfirst because I was creating an extra copy of the vector, when I should have been using a pointer to a vector. So the question then becomes: how do you get access to the pointer to the vector’s memory via a pointer to the vector? Does that make sense?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T01:13:52+00:00Added an answer on May 12, 2026 at 1:13 am

    The elements in a standard vector are allocated as one contiguous memory chunk.

    You can get a pointer to the memory by taking the address of the first element, which can be done is a few ways:

    std::vector<int> vec;
    /* populate vec, e.g.: vec.resize(100); */
    
    int* arr = vec.data();   // Method 1, C++11 and beyond.
    int* arr = &vec[0];      // Method 2, the common way pre-C++11.
    int* arr = &vec.front(); // Method 3, alternative to method 2.
    

    However unless you need to pass the underlying array around to some old interfaces, generally you can just use the operators on vector directly.

    Note that you can only access up to vec.size() elements of the returned value. Accessing beyond that is undefined behavior (even if you think there is capacity reserved for it).

    If you had a pointer to a vector, you can do the same thing above just by dereferencing:

    std::vector<int>* vecptr;
    
    int* arr = vecptr->data(); // Method 1, C++11 and beyond.
    int* arr = &(*vecptr)[0];  // Method 2, the common way pre-C++11.
    int* arr = &vec->front();  // Method 3, alternative to method 2.
    

    Better yet though, try to get a reference to it.

    About your solution

    You came up with the solution:

    int* vMem = vec->_Myfirst;
    

    The only time this will work is on that specific implementation of that specific compiler version. This is not standard, so this isn’t guaranteed to work between compilers, or even different versions of your compiler.

    It might seem okay if you’re only developing on that single platform & compiler, but it’s better to do the the standard way given the choice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 177k
  • Answers 177k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assuming you are using sIFR 3, :first-child is not supported… May 12, 2026 at 3:23 pm
  • Editorial Team
    Editorial Team added an answer You can run App Engine apps on top of appscale… May 12, 2026 at 3:23 pm
  • Editorial Team
    Editorial Team added an answer That sounds like it's evaluating all of the $() expressions… May 12, 2026 at 3:23 pm

Related Questions

I am extending a template class using C++ in Visual Studio 2005. It is
I've been trying to solve this for ages (3 days) now and I just
I have Visual Studio 2008 Professional and I am having issues with expanding and
I have a web application on ASP.NET (C#) that has some precompiled components. I've

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.