Click here to Skip to main content
16,006,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralActiveX For Connecting Database Pin
San13-Dec-01 23:50
San13-Dec-01 23:50 
QuestionWho have a example of setting a picture as background in CRichEditView? Pin
white jungle13-Dec-01 23:03
white jungle13-Dec-01 23:03 
GeneralDummy dialog! Pin
Rickard Andersson2013-Dec-01 22:03
Rickard Andersson2013-Dec-01 22:03 
GeneralRe: Dummy dialog! Pin
Eugene Pustovoyt13-Dec-01 23:35
Eugene Pustovoyt13-Dec-01 23:35 
GeneralRe: Dummy dialog! Pin
Nish Nishant13-Dec-01 23:47
sitebuilderNish Nishant13-Dec-01 23:47 
GeneralDLL questions Pin
13-Dec-01 19:51
suss13-Dec-01 19:51 
GeneralRe: DLL questions Pin
Nish Nishant13-Dec-01 20:10
sitebuilderNish Nishant13-Dec-01 20:10 
GeneralRe: DLL questions Pin
Joaquín M López Muñoz13-Dec-01 23:57
Joaquín M López Muñoz13-Dec-01 23:57 
As far as I know, .DEFs do not provide any means to export a whole C++ class in one fell swoop. The closest you can get is exporting all of the member functions and variables, but this is pretty complicated due to name mangling. This article discusses the issue in greater detail and proposes alternative approaches.

As for the DLL heap manager, I'm afraid what you've heard is true: best way to avoid problems is ensuring that all that is allocated in the DLL is freed by the DLL itself (this post of mine explains what the issues with DLL private heaps are). The most usual technique to deal with this problem is to have exported factory methods like create() and their corresponding destroy()s, as you pointed out. An implication of this is that crossed DLL objects should not be created on the stack (i.e. their ctors should be declared protected).
If you still want to have classes that work safely across DLL boundaries but yet do not resort to create() methods, there's a solution: define and export new, delete and all ctors (including the copy constructor), and put the corresponding definitions in the .cpp file (so that they are not inlined). This way, all the allocation/deallocation works is ensured to be made inside the DLL.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: DLL questions Pin
Nemanja Trifunovic14-Dec-01 5:03
Nemanja Trifunovic14-Dec-01 5:03 
GeneralRe: DLL questions Pin
Joaquín M López Muñoz14-Dec-01 6:12
Joaquín M López Muñoz14-Dec-01 6:12 
GeneralRe: DLL questions Pin
Nemanja Trifunovic14-Dec-01 6:37
Nemanja Trifunovic14-Dec-01 6:37 
GeneralRe: DLL questions Pin
pba_14-Dec-01 6:40
pba_14-Dec-01 6:40 
GeneralRe: DLL questions Pin
Philip Patrick14-Dec-01 14:33
professionalPhilip Patrick14-Dec-01 14:33 
GeneralDisabling buttons Pin
Cam13-Dec-01 16:21
Cam13-Dec-01 16:21 
GeneralRe: Disabling buttons Pin
Michael Dunn13-Dec-01 16:25
sitebuilderMichael Dunn13-Dec-01 16:25 
GeneralRe: Disabling buttons Pin
Nish Nishant13-Dec-01 18:06
sitebuilderNish Nishant13-Dec-01 18:06 
GeneralRe: Disabling buttons Pin
Cam13-Dec-01 18:36
Cam13-Dec-01 18:36 
GeneralGetting a pointer to the view object Pin
Cam13-Dec-01 15:12
Cam13-Dec-01 15:12 
GeneralRe: Getting a pointer to the view object Pin
Rick York13-Dec-01 15:35
mveRick York13-Dec-01 15:35 
GeneralRe: Getting a pointer to the view object Pin
Cam13-Dec-01 15:52
Cam13-Dec-01 15:52 
GeneralRe: Getting a pointer to the view object Pin
Ravi Bhavnani13-Dec-01 17:05
professionalRavi Bhavnani13-Dec-01 17:05 
GeneralRe: Getting a pointer to the view object Pin
Eugene Pustovoyt13-Dec-01 23:48
Eugene Pustovoyt13-Dec-01 23:48 
GeneralHelp me create .inf file in win2000!! Pin
Jerry Hu13-Dec-01 14:30
Jerry Hu13-Dec-01 14:30 
GeneralRe: Help me create .inf file in win2000!! Pin
Nish Nishant13-Dec-01 18:15
sitebuilderNish Nishant13-Dec-01 18:15 
GeneralCDataGrid in C++ Pin
13-Dec-01 12:08
suss13-Dec-01 12:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.