Solved

Exporting class object in MFC

Posted on 1998-08-26
1
154 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Smart Camera scanning and reading information 3 106
has77  challenge 9 85
EvenOdd challenge 10 108
FizzBuzz challenge 9 80
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

773 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