15,920,896 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by TimGalant (Top 8 by date)
TimGalant
18-Oct-11 6:47am
View
Ok, I'am capable of working with structs and pointers to structs. But the problem is that I have a struct (MASTER) with a member that points to another struct (CHILD). I want to set a pointer to the first member of the array of MASTER structs in the CData class. Then I want the class to return a pointer to a value from for example the second struct (iNum = 1). With the normal data members of MASTER that's not a problem because the "distance" in the memory between the members is the same (the size of the MASTER struct). But the distance between the members of the CHILD structs in the memory is different (for example: the distance between the members of the CHILD structs in master[0] and master [2] is 0 because the structs are the same. The CHILD stuct of master[1] is somewhere else (unknown) in the memory because it was dynamically assigned.
So what I want is to return a pointer to for example master[0].pChild->iInt or master[1].pChild->iInt when I only have a pointer to the first member of the array of MASTER structs.
I hope I made clear what I want to do.
TimGalant
17-Oct-11 16:07pm
View
I mean that with a normal array you know "where" in the memory you can find the fourth, tentht, fiftieth etc. variable in the array if you have a pointer to the first variable of the array. With the structures I described above you don't know where in the memory you can find the members of the child structs.
TimGalant
17-Oct-11 15:21pm
View
But when I want to do it as I explained, can it be done and how? Cause the problem with the "alignment" in the memory will be the same, isn't it?
TimGalant
30-Sep-11 13:43pm
View
I've linked the dll as one of the projects in my solution. Normal classes export right, so I don't thinks it's the stuff "around" the coding.
TimGalant
29-Sep-11 12:29pm
View
*Philippe Mori:
As you can see, adding virtual destructors doesn't help. Or am I doing something wrong?
*Stefan_Lang: I've tried your solution, it seems to work with functions but I got the same error message with the contructors.
TimGalant
28-Sep-11 16:02pm
View
Thanks for your help anyway.
TimGalant
28-Sep-11 15:57pm
View
No, if they're non-virtual they're simple derived classes which I'm able to export correctly.
TimGalant
28-Sep-11 15:05pm
View
I want the base class to be the same for CDerivedAB instead of one for CDerivedA and one for CDerivedB, so that's why I use virtual.
Show More