473,396 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

displaying any struct

Is there a function in vc++ that would allow to list as strings all the
contents and names of struct members? A treeview would be
the best for listing. Thanks for aid.

Uf
Apr 22 '06 #1
3 1623
Ufit wrote:
Is there a function in vc++ that would allow to list as strings all the
contents and names of struct members? A treeview would be
the best for listing. Thanks for aid.


If you ask a newsgroup that covers VC++

There is no portable way to do that in the raw C++ language itself. It's
called reflection, but you should announce what real problem you are trying
to solve first. There are portable ways to simulate reflection in C++. And
maybe your problem has some other solution.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 22 '06 #2
> Ufit wrote:
Is there a function in vc++ that would allow to list as strings all the
contents and names of struct members? A treeview would be
the best for listing. Thanks for aid.
If you ask a newsgroup that covers VC++


....they might give me memory pills.

Also, they might point out a way to borrow your program's PDB file, run it
through their debugging system, and emit this data.

That would be a very small bang for a very huge buck.
There is no portable way to do that in the raw C++ language itself. It's
called reflection, but you should announce what real problem you are
trying to solve first. There are portable ways to simulate reflection in
C++. And maybe your problem has some other solution.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!

Apr 22 '06 #3
"Ufit" <ko**************@NOpoczta.fm> wrote in message
news:e2**********@news.onet.pl...
Is there a function in vc++ that would allow to list as strings all the
contents and names of struct members? A treeview would be
the best for listing. Thanks for aid.


Normally that information is not available to a compiled C++ program. Your
compiler may create a file during the compilation process with that
information or you can tell your compiler to create one. That is, the names
of the structures. Perhaps with this information you can cross reference
something you can "see" about the instance with the compiler created file.

The other option is to code this information into the objects themselves.

class MyClass
{
public:
std::string ClassName;
MyClass(): ClassName( "MyClass" );
/* ... */
}
Apr 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: shyamal | last post by:
I want to display memory content using C++ on LINUX. For example, the user may ask to display 256 bytes from 0x1000ff00. The problem is , if any location is invalid, the program will coredump...
1
by: Dave Posh | last post by:
I seem to be having a problem displaying time stored in mysql. The format stored in the database is 13:15:05. The database data type is time. I'm using asp vbscript and sql to retrieve the time...
18
by: Erik Arner | last post by:
Hi, I really need some help here. After upgrading to g++ 3.4 I have run into all sorts of troubles that I'm sure depends on my lack of proper understanding of C++. I would now like to get it right...
2
by: George | last post by:
My program is supposed to draw lines given from certain vertices that are given to me. the colors from the lines are also defined. It should display on a black screen. I am not sure how to do this...
19
by: Russell Shaw | last post by:
Hi, I have two structs in a header file, and they reference each other, causing a compile error. Is there a standard way to deal with this? typedef struct { ... RtAction *actions; }...
0
by: James Dean | last post by:
I have trouble displaying a bitmap. I have 1bpp information. I also have a command telling me what color i need to set the bytes to when the colour is switched on. The trouble is i do all this but...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
12
by: korund | last post by:
How to make javascript alert with non-english text displaying correctly on computers where english only is default system & language settings? For web page the solution is just use meta tags:...
8
by: Jared.Holsopple | last post by:
Hi all, I have a dynamically allocated array of doubles in VC++ .NET. When I view the array in the watch window with "arrayName, 10", it displays the correct value for arrayName, but arrayName...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.