Solved

Exporting class object in MFC

Posted on 1998-08-26
1
159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

724 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