Click here to Skip to main content
16,009,238 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Toggel button with menu open Pin
jan larsen15-Oct-04 2:09
jan larsen15-Oct-04 2:09 
GeneralRe: Toggel button with menu open Pin
Ravi Bhavnani15-Oct-04 6:21
professionalRavi Bhavnani15-Oct-04 6:21 
Questionwhat are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
lavate malllik15-Oct-04 0:50
lavate malllik15-Oct-04 0:50 
AnswerRe: what are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
toxcct15-Oct-04 0:55
toxcct15-Oct-04 0:55 
AnswerRe: what are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
Phil J Pearson15-Oct-04 0:59
Phil J Pearson15-Oct-04 0:59 
GeneralRe: what are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
David Crow15-Oct-04 4:46
David Crow15-Oct-04 4:46 
GeneralRe: what are the basic setting we have to do in the Microsoft Visual Studio to run this code? Pin
Ravi Bhavnani15-Oct-04 6:23
professionalRavi Bhavnani15-Oct-04 6:23 
GeneralMFC message routing weirdness Pin
Phil J Pearson15-Oct-04 0:47
Phil J Pearson15-Oct-04 0:47 
Sorry if this seems complex (it is!). Please bear with me.

I have an application that calls into a dll. The app is dynamically linked to MFC; the dll is statically linked. Both are MFC71. Rough outline of problem is:

1. App creates a CWnd
2. App calls into dll
3. Dll creates a CWnd (uses AFX_MANAGE_STATE everywhere necessary)
4. App destroys window created in step 1 (it was a splash dialog)

here comes the weirdness...
5. Dll's AfxWndProcDllStatic processes WM_NCDESTROY and ends up calling MFC's OnNcDestroy for the window created in step 3.
6. OnNcDestroy calls PostNcDestroy which does delete this; for the CWnd from step 3. Cry | :((
7. Everything else carries on sweetly until the dll tries to reference data in the CWnd that was vandalised.

Please can someone explain what the ? is happening to cause step 5? Confused | :confused: Confused | :confused: Confused | :confused:

Incidentally, all this happens on the same (main) thread, although other threads do get created elsewhere.

Thanks in advance,
Phil



The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
GeneralRe: MFC message routing weirdness Pin
Blake Miller15-Oct-04 4:25
Blake Miller15-Oct-04 4:25 
GeneralRe: MFC message routing weirdness Pin
Phil J Pearson15-Oct-04 4:43
Phil J Pearson15-Oct-04 4:43 
GeneralRe: MFC message routing weirdness - solved! Pin
Phil J Pearson15-Oct-04 5:18
Phil J Pearson15-Oct-04 5:18 
QuestionHow can I receive mails that is coming to my outlook in an MFC appliation. Pin
VCSharp00714-Oct-04 23:32
VCSharp00714-Oct-04 23:32 
AnswerRe: How can I receive mails that is coming to my outlook in an MFC appliation. Pin
Mad__14-Oct-04 23:46
Mad__14-Oct-04 23:46 
AnswerRe: How can I receive mails that is coming to my outlook in an MFC appliation. Pin
Sujan Christo14-Oct-04 23:50
Sujan Christo14-Oct-04 23:50 
General[Message Deleted] Pin
sheny14-Oct-04 23:17
sheny14-Oct-04 23:17 
GeneralRe: How many programs uses "this" dll? Pin
Phil J Pearson15-Oct-04 1:15
Phil J Pearson15-Oct-04 1:15 
GeneralRe: How many programs uses "this" dll? Pin
benjymous15-Oct-04 1:45
benjymous15-Oct-04 1:45 
GeneralRe: How many programs uses "this" dll? Pin
Phil J Pearson15-Oct-04 4:14
Phil J Pearson15-Oct-04 4:14 
GeneralData Type conversion. Pin
VCSharp00714-Oct-04 23:14
VCSharp00714-Oct-04 23:14 
GeneralRe: Data Type conversion. Pin
Mad__14-Oct-04 23:32
Mad__14-Oct-04 23:32 
GeneralRe: Data Type conversion. Pin
VCSharp00714-Oct-04 23:35
VCSharp00714-Oct-04 23:35 
GeneralRe: Data Type conversion. Pin
Mad__14-Oct-04 23:40
Mad__14-Oct-04 23:40 
GeneralRe: Data Type conversion. Pin
VCSharp00715-Oct-04 1:25
VCSharp00715-Oct-04 1:25 
GeneralRe: Data Type conversion. Pin
Mad__15-Oct-04 1:34
Mad__15-Oct-04 1:34 
GeneralRe: Data Type conversion. Pin
VCSharp00715-Oct-04 1:55
VCSharp00715-Oct-04 1:55 

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.