Click here to Skip to main content
15,921,989 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Knowing when user deletes a file with CFileDialog Pin
Mark Salsbery7-Dec-07 9:18
Mark Salsbery7-Dec-07 9:18 
GeneralClass Constructor Problem Pin
Lea Hayes7-Dec-07 6:47
Lea Hayes7-Dec-07 6:47 
GeneralRe: Class Constructor Problem Pin
Lea Hayes7-Dec-07 7:13
Lea Hayes7-Dec-07 7:13 
GeneralRe: Class Constructor Problem Pin
Cedric Moonen7-Dec-07 7:15
Cedric Moonen7-Dec-07 7:15 
AnswerRe: Class Constructor Problem Pin
Nathan Holt at EMOM7-Dec-07 7:16
Nathan Holt at EMOM7-Dec-07 7:16 
GeneralRe: Class Constructor Problem Pin
Lea Hayes7-Dec-07 7:55
Lea Hayes7-Dec-07 7:55 
QuestionRe: Class Constructor Problem Pin
Maximilien7-Dec-07 7:18
Maximilien7-Dec-07 7:18 
GeneralRe: Class Constructor Problem Pin
Lea Hayes7-Dec-07 7:50
Lea Hayes7-Dec-07 7:50 
GeneralRe: Class Constructor Problem Pin
led mike7-Dec-07 8:28
led mike7-Dec-07 8:28 
GeneralRe: Class Constructor Problem Pin
cp98767-Dec-07 9:45
cp98767-Dec-07 9:45 
Generalkeyboard buffer Pin
RomTibi7-Dec-07 6:40
RomTibi7-Dec-07 6:40 
AnswerRe: keyboard buffer Pin
Nathan Holt at EMOM7-Dec-07 7:23
Nathan Holt at EMOM7-Dec-07 7:23 
GeneralRe: keyboard buffer Pin
RomTibi9-Dec-07 4:29
RomTibi9-Dec-07 4:29 
General(Dundas Grid related) Modal dialog called from an event in the grid is not modal at all. [modified](SOLVED) Pin
Maximilien7-Dec-07 5:45
Maximilien7-Dec-07 5:45 
GeneralRe: (Dundas Grid related) Modal dialog called from an event in the grid is not modal at all. Pin
James R. Twine7-Dec-07 6:14
James R. Twine7-Dec-07 6:14 
GeneralCObject (CView - CDoument) callbacks Pin
Tony Teveris7-Dec-07 4:48
Tony Teveris7-Dec-07 4:48 
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 

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.