Solved

Exporting class object in MFC

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 134
maxBlock challenge 30 145
wait notify demo infinite loop 3 135
My project did see openJDK that I installed. What could be the problem 7 160
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 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