Solved

Exporting class object in MFC

Posted on 1998-08-26
1
152 Views
Last Modified: 2013-11-19
I'm creating my first DLL and I'm a bit confused and having trouble finding the answer in the DevStudio documentation. (I'm using DevStudio 5.0 on windows NT)

I have a set of high level access functions which refer to a class CMyClass. What I'd like is for the user to be able to get a pointer to a CMyClass object so that they can pass that pointer into the high level access functions but not allow the users of the dll get at the member functions or content of the class object. I have found the documentation on exporting the class but it specically mentions encluding the full class definition for the user of the dll. I know I'm missing something. I'd appreciate any help.
0
Comment
Question by:winkle
1 Comment
 
LVL 2

Accepted Solution

by:
milenvk earned 50 total points
ID: 1321331
You cannot do that. The C++ language reference says:
"Note that explicit use of the dllimport and dllexport attributes on members of an exportable class is prohibited."

And there is no other easy way of exportin classes from DLLs. Of course you should consider putting all the members and member functions in the protected section of your class.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Detect CR LF to each line 12 137
has77  challenge 9 68
wordappend challenge 8 85
Sed question 2 48
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now