Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CObject (CView - CDoument) callbacks Pin
led mike7-Dec-07 6:04
led mike7-Dec-07 6:04 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Mark Salsbery7-Dec-07 6:24
Mark Salsbery7-Dec-07 6:24 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Tony Teveris7-Dec-07 6:51
Tony Teveris7-Dec-07 6:51 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Mark Salsbery7-Dec-07 7:11
Mark Salsbery7-Dec-07 7:11 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Tony Teveris7-Dec-07 7:18
Tony Teveris7-Dec-07 7:18 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Mark Salsbery7-Dec-07 7:34
Mark Salsbery7-Dec-07 7:34 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Tony Teveris7-Dec-07 8:03
Tony Teveris7-Dec-07 8:03 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Mark Salsbery7-Dec-07 8:18
Mark Salsbery7-Dec-07 8:18 
Tony Teveris wrote:
I have to ask the programmer of the main app some questions.


Yes Smile | :)

The module state stuff can affect CWnd pointers across the EXE/DLL
module boundary depending on the type of DLL. This needs to be managed correctly.

The CHandleMap is related to the module state. Your CView is in the EXE's map but in the
DLL function, you've changed the module state, so when the callback is called, the
code on the EXE side isn't finding the CView object in the DLL's map.

That's why the type of DLL is important. With a properly initialized extension DLL,
you don't need to use the AFX_MANAGE_STATE macro. Using an MFC extension DLL
is definitely the best/easiest for passing CWnds back and forth across the EXE/DLL boundary.
The drawback to an extension DLL is it can't be used by a non-MFC EXE.

If you must use a standard DLL, then you'll need to manage the module state for
your callback.

Mark


Mark Salsbery
Microsoft MVP - Visual C++


Java | [Coffee]

GeneralRe: CObject (CView - CDoument) callbacks Pin
Tony Teveris7-Dec-07 8:23
Tony Teveris7-Dec-07 8:23 
GeneralRe: CObject (CView - CDoument) callbacks Pin
Mark Salsbery7-Dec-07 8:29
Mark Salsbery7-Dec-07 8:29 
GeneralExecutable application Pin
llp00na7-Dec-07 4:28
llp00na7-Dec-07 4:28 
GeneralRe: Executable application Pin
led mike7-Dec-07 4:59
led mike7-Dec-07 4:59 
GeneralRe: Executable application Pin
llp00na7-Dec-07 5:09
llp00na7-Dec-07 5:09 
GeneralRe: Executable application Pin
led mike7-Dec-07 5:31
led mike7-Dec-07 5:31 
GeneralRe: Executable application Pin
Eytukan7-Dec-07 5:20
Eytukan7-Dec-07 5:20 
GeneralRe: Executable application Pin
llp00na7-Dec-07 5:28
llp00na7-Dec-07 5:28 
GeneralRe: Executable application Pin
Eytukan7-Dec-07 5:35
Eytukan7-Dec-07 5:35 
GeneralRe: Executable application Pin
llp00na7-Dec-07 6:04
llp00na7-Dec-07 6:04 
GeneralRe: Executable application Pin
Eytukan7-Dec-07 6:14
Eytukan7-Dec-07 6:14 
QuestionRe: Executable application Pin
Maximilien7-Dec-07 5:26
Maximilien7-Dec-07 5:26 
GeneralRe: Executable application Pin
llp00na7-Dec-07 5:29
llp00na7-Dec-07 5:29 
GeneralRe: Executable application Pin
Eytukan7-Dec-07 5:30
Eytukan7-Dec-07 5:30 
GeneralRe: Executable application Pin
llp00na7-Dec-07 6:01
llp00na7-Dec-07 6:01 
QuestionCode structure Pin
chanduabcchandu7-Dec-07 0:48
chanduabcchandu7-Dec-07 0:48 
GeneralRe: Code structure Pin
CPallini7-Dec-07 1:18
mveCPallini7-Dec-07 1:18 

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.