Click here to Skip to main content
15,917,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Redirecting the registy. Pin
Fredrik25-Sep-00 21:44
Fredrik25-Sep-00 21:44 
GeneralReal time recording Pin
ba20-Sep-00 1:13
ba20-Sep-00 1:13 
GeneralRe: Real time recording Pin
bobbies9-May-01 2:01
bobbies9-May-01 2:01 
QuestionHow to change the PropertySheet tab caption's color Pin
zhangyu19-Sep-00 23:05
zhangyu19-Sep-00 23:05 
Question_crtBreakAlloc doesn't evaluate? Pin
Brendan Tregear19-Sep-00 13:52
Brendan Tregear19-Sep-00 13:52 
AnswerRe: _crtBreakAlloc doesn't evaluate? Pin
Sam Hobbs19-Sep-00 14:19
Sam Hobbs19-Sep-00 14:19 
AnswerRe: _crtBreakAlloc doesn't evaluate? Pin
Tim Deveaux20-Sep-00 3:22
Tim Deveaux20-Sep-00 3:22 
GeneralRe: _crtBreakAlloc doesn't evaluate? Pin
Brendan Tregear20-Sep-00 13:37
Brendan Tregear20-Sep-00 13:37 
GeneralRe: _crtBreakAlloc doesn't evaluate? Pin
Tim Deveaux21-Sep-00 6:22
Tim Deveaux21-Sep-00 6:22 
GeneralRe: _crtBreakAlloc doesn't evaluate? Pin
Brendan Tregear21-Sep-00 15:13
Brendan Tregear21-Sep-00 15:13 
General** Random Number Generator ** Pin
Steve Lai19-Sep-00 10:47
Steve Lai19-Sep-00 10:47 
GeneralRe: ** Random Number Generator ** Pin
Erik Funkenbusch19-Sep-00 12:57
Erik Funkenbusch19-Sep-00 12:57 
GeneralRe: ** Random Number Generator ** Pin
WoR20-Sep-00 21:43
WoR20-Sep-00 21:43 
Generalextended style MFC Pin
kennan19-Sep-00 10:22
kennan19-Sep-00 10:22 
GeneralRe: extended style MFC Pin
Erik Funkenbusch19-Sep-00 13:08
Erik Funkenbusch19-Sep-00 13:08 
GeneralSingle Instance DLL Pin
Larry Dobson19-Sep-00 9:34
Larry Dobson19-Sep-00 9:34 
GeneralRe: Single Instance DLL Pin
Erik Funkenbusch19-Sep-00 13:07
Erik Funkenbusch19-Sep-00 13:07 
GeneralRe: Single Instance DLL Pin
Larry Dobson19-Sep-00 17:03
Larry Dobson19-Sep-00 17:03 
GeneralRe: Single Instance DLL Pin
Erik Funkenbusch20-Sep-00 9:14
Erik Funkenbusch20-Sep-00 9:14 
GeneralPaint problems Pin
Ori19-Sep-00 7:56
Ori19-Sep-00 7:56 
GeneralISAPI Filter Pin
Anderson J Almeida19-Sep-00 7:21
sussAnderson J Almeida19-Sep-00 7:21 
GeneralODBC API, BLOBs Pin
Oz Ben Eliezer19-Sep-00 7:12
Oz Ben Eliezer19-Sep-00 7:12 
QuestionInteresting Question on DLL...use class* as a parameter../?? Pin
Ryan Park18-Sep-00 23:52
Ryan Park18-Sep-00 23:52 
AnswerRe: Interesting Question on DLL...use class* as a parameter../?? Pin
Jignesh Patel19-Sep-00 4:12
Jignesh Patel19-Sep-00 4:12 
There are a few things that you'd need to change to make it work the way that you intended it to work.

First of all, you need to change the Set function to take in a pointer to a pointer.

Secondly, in your set function you are creating a CA object on the stack (which will get destroyed as soon as the function returns, even though you may have copied the correct address - which doesn't happen anyway.

Try this...
In DLL:

Set(CA** ppCAInDll)
{
CA * pA = new CA;
*ppCAInDll = pA;
}

In EXE:
CA* inexe = NULL;
Set(&inexe);
inexe->aa();
inexe->bb();


Make sure you delete the object pointed to by inexe, since it's been new'ed in the dll.

GeneralRe: Interesting Question on DLL...use class* as a parameter../?? Pin
Ryan Park19-Sep-00 16:16
Ryan Park19-Sep-00 16:16 

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.