OnDestroy or PostNcDestroy warning

Hello,
I have quick question if that warning is something to worry about:
Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in 
derived class will not be called.

thanks 


0
bulba (17)
5/20/2005 4:37:54 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1710 Views

Similar Articles

[PageSpeed] 22

On Fri, 20 May 2005 12:37:54 -0400, zorman wrote:

> Hello,
> I have quick question if that warning is something to worry about:
> Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in 
> derived class will not be called.
> 
> thanks

It indicates you have a window whose C++ object is being destroyed while
the attached HWND is still alive, and CWnd's destructor is calling
DestroyWindow(m_hWnd). Whether or not this is a problem depends on the
characteristics of the derived class, e.g. if they override OnDestroy and
PostNcDestroy, what they do inside those functions. You should determine
which window is being destroyed in this way and decide whether or not this
is appropriate.

-- 
Doug Harrison
Microsoft MVP - Visual C++
0
dsh (2498)
5/20/2005 8:51:36 PM
thank you!

"Doug Harrison [MVP]" <dsh@mvps.org> wrote in message
news:11dlu5nkm8n6r$.fxwvuzs7ji5p$.dlg@40tude.net...
> On Fri, 20 May 2005 12:37:54 -0400, zorman wrote:
>
> > Hello,
> > I have quick question if that warning is something to worry about:
> > Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or
PostNcDestroy in
> > derived class will not be called.
> >
> > thanks
>
> It indicates you have a window whose C++ object is being destroyed while
> the attached HWND is still alive, and CWnd's destructor is calling
> DestroyWindow(m_hWnd). Whether or not this is a problem depends on the
> characteristics of the derived class, e.g. if they override OnDestroy and
> PostNcDestroy, what they do inside those functions. You should determine
> which window is being destroyed in this way and decide whether or not this
> is appropriate.
>
> --
> Doug Harrison
> Microsoft MVP - Visual C++


0
kc2ine (84)
5/23/2005 4:08:28 AM
Reply:

Similar Artilces:

OnDestroy
When we have some GDI object created when the programming was running, and the window is now beeing closed, is this function a good place to deselect from the DC and destroy them? Does the window still exist when this function is called? I called GetSafeHWnd() in a CDialog class and GetDC() before and after the call to CDialog::OnDestroy(); and they always return valid handles. MSDN says "The framework calls this member function to inform the CWnd object that it is being destroyed. OnDestroy is called after the CWnd object is removed from the screen. " What do they mean by beei...

Cannot Disable Security Warning Message
I am broadcasting a member email from a local database. When the email is sent, the security feature in Outlook 2002 forces me to respond to the following message for each email (which is time consuming). "A program is tring to automatically send email on your behalf. Do you want to allow this." Is there a way to disable this security feature? Kathie http://64.78.15.8/outlook/esecup.htm#autosec has information on this subject. -- Cheryl Fischer Law/Sys Associates Houston, TX "Kathie Itter" <kathie@woma.org> wrote in message news:04eb01c356e1$fc475730$a...

Warning message on "number of data points"
I am plotting 24 hour rolling data that gets updated every minute. Data comes from an Excel Query data base and is graphed in four different charts (separate worksheets). Refresh is enabled when opening file but before the actual charts update a warning message comes on several times, which says: "The maximum number of data points you can use in a data series for a 2-D chart is 32,000. If you want to use more than 32,000 data points, you must create two or more series" I don't really know what all this exactly means and what "two or more series" it is talkin...

I have no idea what's causing this security warning.
I am using Outlook XP 2002 SP3. I just installed this recently and I finally got around to puttin in contacts. As soon as I add a contact, I get this error message repeatedly: 'A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose "No".' I have no idea what other program could be accessing the contacts. If I select "yes" or "no" then Outlook gives me the same message again a few seconds later. It gives it to me continuously, no matter what ...

Question about OnDestroy()...
I have created an image list for icons to be later used in a CListCtrl and CTreeCtrl. HIMAGELIST hList = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 0, 1); ASSERT(hList != NULL); m_cMyImageList.Attach(hList); in the OnDestroy for the dialog I do my additional cleanup work. My question is do I have to use: m_cMyImageList.DeleteImageList(); or m_cMyImageList.Detach(); method or both? What are the differences in the two (not clear)? Along the same lines, I have created some bitmaps for custom button controls as follows: CBitmap m_hBrowseBmp; // declared in header file. /...

irritating warning for negative data on log charts
I know perfectly well that I can't plot negative values on a log chart. That doesn't mean that my data doesn't have negative numbers in it. Is there any way that anybody knows to disable this irritating message? My productivity drops 100% because every time I scroll around in a sheet that happens to have a negative number on a log chart somewhere, this irritating dialog pops up. I don't want to have to build my own log charts that ignore negative numbers (I could, but what's the point of a built-in log chart if you can't use it). I don't want to have to w...

WARNING: Opinion
I read several Excel blogs, though hardly ever post in them (with one big exception). This is purely an opinion piece on my reaction to other people's reactions to Excel 2007 and the upcoming Excel 2010. -- Grudging recognition of what Microsoft has done right on its own initiative -- Excel 97 and VBA 5.x - Microsoft killed off Lotus 123 with this version 12 years ago, deservedly. Excel 2000's support for OLAP cubes and pivot table improvements. Excel 2003 lists which improved into Excel 2007 tables. -- Improvements Microsoft was dragged kicking & screaming to make -- Excel 200...

User don't get storage limit warnings
We use Exchange 2003 and Outlook 2000 and 2003. I have notice that none us ever get storage limit alerts, even though they are all set to get these. Any ideas? Look at the properties of your mailbox store object in ESM. On the Limits tab, check the warning message interval schedule. Is it scheduled to run? -- Neil Hobson Exchange MVP "SW" <SW@discussions.microsoft.com> wrote in message news:395BB798-E273-47C6-B75B-E1034DE06D61@microsoft.com... > We use Exchange 2003 and Outlook 2000 and 2003. I have notice that none > us > ever get storage limit alerts, e...

OnDestroy or PostNcDestroy warning
Hello, I have quick question if that warning is something to worry about: Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in derived class will not be called. thanks On Fri, 20 May 2005 12:37:54 -0400, zorman wrote: > Hello, > I have quick question if that warning is something to worry about: > Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in > derived class will not be called. > > thanks It indicates you have a window whose C++ object is being destroyed while the attached HWND is still alive, and CWnd's dest...

Excel warns that the file has changed when it hasn't
I have a rather large Excel file, with 15 sheets. I am finding that if I open and then try to immediately close it, Excel warns "Do you want to save the changes you made to ..", even though I haven't changed a thing (or even typed anywhere in the file). What's going on? This is using Office XP, with SP3 installed. Bill Do you have any of these volatile functions in your workbook? AREAS() INDEX() OFFSET() CELL() INDIRECT() ROWS() COLUMNS() NOW() TODAY() RAND() These evaluate with each calculation. And cause excel to think your workbook ha...

how to disable warning box warning against MS Word trying to send an email
Hi all, I use email in my office frequently. I'd like to disable the Outlook warning box that cautions a "program is trying to send an email." I use Windows XP and Word 2000. I know I saw a message when using a later version that offered to disable or otherwise alter the warning. Suggestions will be appreciated. :) Gil Carter Hi Gil, there is an Add on or call it programm which is clicking the OK automatically. Please look here http://www.contextmagic.com/express-clickyes/ -- Ich habe nichts gemacht, gestern gings noch! Bitte in den Newsgroup antworten damit jeder etw...

Clean-up in OnDestroy
Hi, In my dialog based MFC application I put all clean-up code into OnClose (). Recently I noticed that calling EndDialog () closes the application but without executing OnClose (). So I move my clean-up code into OnDestroy (). May this cause any validity problems? Thanks in advance What are you cleaning up? If the cleanup does not require access to the controls then you should put the cleanup code in the destructor. AliR. "K�r�at" <xx@yy.com> wrote in message news:OGiL391tIHA.4560@TK2MSFTNGP03.phx.gbl... > Hi, > > In my dialog based MFC application I p...

Addressbook warnings
I have looked for a way to resolve this warning and haven't really found what I am looking for: Event Type: Warning Event Source: MSExchangeIS Public Store Event Category: Access Control Event ID: 1235 Date: 3/6/2006 Time: 3:09:48 PM User: N/A Computer: EXCHANGER Description: jdoe@domain.com failed an operation on folder on database "First Storage Group\Public Folder Store (EXCHANGER)" because the user did not have the following access rights: 'Delete' 'Read Property' 'Write Property' 'Create Message' 'View Item' 'Create Subfolder...

QUESTION about LINK : warning ?
This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C49FB4.2F3700C0 Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable Dear: I build an ISAPI Filter using Extension Wizard ,when I Build a release = version of the filter the following warning appeared: LINK : warning LNK4089: all references to 'OLEAUT32.dll' discarded by = /OPT:REF why this warning generated? and what it is mean? Regards ------=_NextPart_000_0008_01C49FB4.2F3700C0 Content-Type: text/html; charset="windows-1256" Content-Transfer-...

Security Warning Data connections have been disabled
Every time I bring up my spread sheet I get this waring at the top of the page. There is an options button with two options: 1. Help protect me from unknown content (recommended) 2. Enable this content. It doesn't seem to matter which option I select...it keeps coming back. How do I keep that from happening? This means that the workbook you're opening has macros. And since some people can write macros that do bad things, excel is asking you to decide what should happen. If you developed these workbooks and they shouldn't have macros, then you can use the techniques at Debra ...

Why doesn't the 2003 outlook warn you of full mailbox anymore??
the new outlook is not better. It does not warn you of a full mailbox like the old one. the Thesaurus does not replace like it used too, just too darn complicated without the easy stuff! ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/office...

Certificate warning
When I send/receive e-mail in outlook I get the following message. "The server you are connected to is using a security certificate that could not be verified. A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider. Do you want to continue using this server?" It's no problem really but an annoyance, is there anything I can do to stop this message? Thank you Henry ...

PostNcDestroy delete this; ?
So, modeless dialog boxes are recommended to call PostNcDestroy for clean up. I see how this is a way to let the object clean itself up, but I see problems. I do // create m_pDialog = new CModelessDlg; m_pDialog->Create(...); // clean up delete m_pDialog; I think my way works, and is better, because, if you use the PostNcDestroy cleanup, what happens if the above call fails in Create ? The object has been allocated using new, but window has not beeen created, and so PostNcDestroy won't be called. I can put in my DestroyWindow of the window creating the modeless dialog: CTheCreating...

Warning a user?
I would like to warn a user that data input for certain cells must be entered on another sheet. Example: If the user tries to enter data I would like a box to come up and say "Data must be entered on Sheet1" Can someone tell me how this can be done. Thanks in advance. Ed Davis Yes, but you would need to use VBA. Why not: - open your second sheet - navigate to the cell where you want value copied; - press '=' - click on the cell in the workbook where the user enters the value - press [Enter]. Now when the value changes, the second sheet will update without the user n...

WM_ENDSESSION OnClose OnDestroy...
Hi, According to MS when WM_ENDSESSION is called WM_DESTROY an onClose are no longer called. Does anybody know the reason why? Doesn't it make the whole call WM_DESTROY a bit useless? I have some list ctrls that need to free some memory before the window is destroyed where should I put the clean-up to ensure that it is called both when the user close the dialog or it is closed when the user logs off? Many thanks Sims "David Lowndes" <davidl@mvps.org> wrote in message news:2qpqhvsc0ust8o44mqcc8r63ruulala05a@4ax.com... > >According to MS when WM_ENDSESSION is ca...

[Beta] ESENT warning event
This is a multi-part message in MIME format. ------=_NextPart_000_0163_01CB410F.7905CFD0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 SSB3YXMgYSB0cmlmbGUgZGlzY29uY2VydGVkIHRvIHNlZSB0aGlzIGluIHRoZSBsb2cgdGhpcyBt b3JuaW5nOg0KDQp3bG1haWwgKDYxMzYpIFdpbmRvd3NMaXZlTWFpbDA6IEEgcmVxdWVzdCB0byB3 cml0ZSB0byB0aGUgZmlsZSAiQzpcVXNlcnNcTm9lbFxBcHBEYXRhXExvY2FsXE1pY3Jvc29mdFxX aW5kb3dzIExpdmUgTWFpbFxNYWlsLk1TTWVzc2FnZVN0b3JlIiBhdCBvZmZzZXQgMTA5NzQwMDMy ICgweDAwMDAwMDAwMDY4YTgwMDApIGZvciA4MTkyICgweDAwMDAyMDAwKSBieXRlcyBzdWNjZWVk ZWQsIGJ1dCB0b29rIGFuIGFib...

Completed With Warnings
I have a couple of worksheets with status "Completed With Warnings" for only one of many stores. How do I figure out what the warning is and how to correct it? I can only see history for a few days in the stores HQ Client Log, and these worksheets were a few weeks ago. depending on the worksheet type, for example u might get a warning if using worksheet 250 for an item that was not found in the store database u can check the log in the store in hq, the history remains in hQ until u delete it, and remains in the store unless u delete the hq client log file. "Jason"...

Windows Live shuts down (No warning)
Recently and I mean within the last 2 days I noticed that when I start my Windows Live and I click on one of my 3 email accounts it closes... not warning just brings me back to the Desktop. Happens more often when I select 1 certain hotmail account (I have 2 added to Windows Live). It takes about 3-4 tries of restarting Live to get it to work. Of course if I deleted any emails from my other 2 accounts they reappear as if I didn't remove anything. Its very strange. So I tried to see if there was an update, but since I don't have IE as my default browser MS was giving m...

Warning screen
Hello everybody, I've tried the flashing formulas and they worked but the problem is that they make the sheet to slow to work with:(. Now I want to try to make a warning pop up screen which warns when something is filled in, in one or more of the following cells: B17, B33, B42 and B54, after pushing a finish button. (The cells mentioned above already automaticly change into an empty cell when a related cell is filled in and normally warn that something is not filled in) How can I do this? :confused: :confused: Thank in advance for the help!!! ---------------------------------------...

AppleScript warning
Hi, scripts written for older versions (especially X) may not work unchanged with 2008. I recommend using Script Editor to save all of your scripts as plain text files before even installing Office 2008! Apparently even if older versions are still on your hard drive 2008 takes precedence in such a way that Script Editor is no longer able to decompile script files using old terminology into readable code. -- Tobias Weber ...