|
Document template is deleted by CDocManager destructor. CDocManager is an internal MFC class. Can you put breakpoint in CWinApp::~CWinApp - it's appcore.cpp file in mfc\src, at least in VC6. You should see the following code:
if (m_pDocManager != NULL)
delete m_pDocManager;
Maybe for some reason m_pDocManager is NULL?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
It is called and m_pDocManager is NULL !
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Can you check m_pDocManager at the end of CYourApp::InitInstance?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Yup,
Its declared in AddDocTemplate
and its still NOT null by the end of InitInstance()
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Jawache wrote:
and its still NOT null by the end of InitInstance()
This is how it's expected to work.
Now, the advanced breakpoint stuff. Open the breakpoints dialog box (Ctrl+B), select the 'Data' tab and type 'theApp.m_pDocManager' (without apostrophes) in the 'Enter the expression to be evaluated' box. Run the program - you should hit the bkpt in the InitInstance first (this is when it's initialized), then for the second time when it gets nullified.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Argh....
The breakpoint is called when the m_pDocManager is initiated but isn't when it goes back to NULL?? -- Hmm.. soounds like VC itself is buggered...
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Jawache wrote:
The breakpoint is called when the m_pDocManager is initiated but isn't when it goes back to NULL
Well, it never goes back to NULL in correctly behaving app. CWinApp::~CWinApp just deletes m_pDocManager. But you're sure that at this point m_pDocManager is NULL when your app exits?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Yes,
It's definately null by the time the destructor is called, but the conditional breakpoint isn't called.
Does the advanced breakpoint work if its a memory overwrite ?
Interesting point -- I put a breakpoint in the connstructor and its actually called twice? I thought there was only ever 1 CWinApp derived object.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Jawache wrote:
I put a breakpoint in the connstructor and its actually called twice? I thought there was only ever 1 CWinApp derived object
Yes, there should be exactly one CWinApp-derived object. Look at the call stack when code hits the breakpoint in constructor.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
The first CWinApp Derived is
CWinApp _afxOleWinApp;
the second is the normal
CExplorerApp theApp;
I think its safe at this point to mention that i'm using some activeX controls in my applications. I suppose thats what the _afxOleWinApp is all about.
The constructor is called twice becuase two objects are created, but the destructor is called once.
I think i've got it.
The descructor is called for _afxOleWinApp and since no documents have been added to this one the m_pDocManager is NULL by the time the destructor is called.
This must cause some error and the app to terminate incorrectly.
What is _afxOleWinApp is this correct behavior, to have 2 WinApps?
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
_afxOleWinApp is defined in dll-related MFC source files. The comment next to declaration states that '// This CWinApp is required so this module state has a CWinApp object!'
It seems you're somehow managed to mix dll-mode MFC into your .exe. Is _afxOleWinApp declared in dllinit.cpp or dllole.cpp?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
its declared in dllole.cpp
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Jawache wrote:
its declared in dllole.cpp
Maybe your ActiveX controls are MFC-based?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
I reckon they are.. i'll contact the author.
Should it matter though, I thought the whole COM ActiveX thing was entirely self contained i.e. it shouldn't matter what they are written in as long as they have the same interface.
So basically, CExplorerApp theApp; is not being destroyed. So VC is picking up memory leaks.
There must be an error after the destruction of _afxOleWinApp before theApp can be destroyed.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Got it.
The brute force method. Make a baseline and then change code randomly untill it goes away.
Turns out it was some sort of strange recursicve pointer deletion in the Splitter Window Class.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Is there any way to set a contitional breakpoint when m_pDocManager changes or something?
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Hi dear,
I want to save the CDC class content into a bitmap file.
How can I do this?
I've done it by using GDI+ simply because this functionality exists in GDI+ library. But I don't wanna use GDI+ in my application.
|
|
|
|
|
I hope you don't mind me asking but i was looking to implement similar functionality in my app a bit later.
Is there an article or some information you can point me to as to how to accomplish this?
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Hi dear,
I'm looking for a class or library for crating a 3D plot
for x,y,z series of data, programmatically.
a 3D plot, as you've seen in MATLAB software.
Thank you in advance.
|
|
|
|
|
Have you tried octave.
Only used it on UNIX nut i'm pretty sure its available for Windows.
http://www.octave.org/
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Have you tried ROOT ?
http://root.cern.ch/
Jonathan de Halleux, Belgium.
|
|
|
|
|
Hello,
I try to figure myself, but can't, so please help:
I want to place a input box and a button in taskbar,
which stay there all the time. When user have to search for a
keyword, type it in input and hit the button.
Which is the way to place windows controls in taskbar?
But in system tray instead??
Thanks in advance.
|
|
|
|
|
You need to create either a application bar or a taskbar (band?) which contains your controls.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
Objects in the taskbar are called "Desktop bands". Article here[^]
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site. Support for development will ship at the same time as the Windows XP Service Pack 1 (SP1) release.
|
|
|
|
|
Thanks a lot, at least I know now what
I'm searching. I really forgoted the
term "Desktop band", and I did lot of searches
after other keywords.
Regards
|
|
|
|