Solved

Exporting class object in MFC

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 106
WinWaitActive parameters 12 31
substring method in java 1 98
Is there a simple front-end menu system. 9 72
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

863 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

24 Experts available now in Live!

Get 1:1 Help Now