|
Hello,
Why do you think that it is no leak?
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
What you are seeing are false positives. Probably stuff that gets allocated as part of global variable initialization. The CRT memory report is happening prior to those global variables getting destroyed.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks for your reply. Since I ran the code this morning, the memory leaks disappeared! I'll be happy as long as they stay away
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Turn on CRT Debug checks at the start of main() and off again at the end. See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/_core_using_the_debug_heap.asp
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Hello,
Thanks for your reply. I was checking the leak again this morning and it disappeared! Anyway, as long as it stays this way...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Well I get the error: ASSERT(::IsWindow(m_hWnd));
On my main dialog I show the modless dialog and on the modless dialog I try to close it.
MAIN dialog
CModless m_modless;
m_modless.ShowWindows(SW_SHOW); // Works Greate
Modless dialog (on close )
CModless m_modless;
m_modless.ShowWindow(SW_HIDE); // Get the error.
On initdialog on the main dialog I use,
m_modless.Create(IDD_MODLESS); // To create the modless dialog.
It works to show the dialog but not to close it.
What Im I doing wrong?
|
|
|
|
|
I dont' know if you put the CModless m_modless in both places just for our benefit, but a modeless dialog needs to be declared as a member variable of the calling class. If it's declared as a local variable, it goes out of scope as soon as the function's over.
But this is what I do. When I create the modeless dialog, I send in a pointer to the calling class. In the calling class, I #define something like WM_CLOSE_MYDIALOG as WM_USER + 101. Then in the modeless dialog's close handler I do this:
m_pCallingClass->SendMessage(WM_CLOSE_MYDIALOG);
make a message map for that message in the calling class, and in the handler call DestroyWindow() for the modeless dialog member variable. hope this helps, because you did help me. Thanks!!
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
|
I posted a question a little while ago, and someone helped me with using an embedded dialog. It worked, but I have two problems.
1. the dialogs show up ok, but if I hit the Enter key, my dialog disappears.
2. The second dialog has a dialog embedded in a static text control (like it is itself), but the smaller dialog has a Custom Control on it that I'm using for an instance of Chris Maunder's MFC Grid Control. Everything else shows up in the smaller dialog except for the custom control.
Does anyone have any suggestions? Oh, the static control is on a CFormView. I chose to use the CFormView to utilize some of the Doc/View architecture, but I still need the CDialog-derived classes for other purposes.
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
When you press enter key you get to the OnOK(); and OnClose(); you must set some he on that funktions.
|
|
|
|
|
the custom control wasn't showing up because the style wasn't set right, and the enter button was like the answer to my post said, I just had to overrid trhe OnOK() handler and put a return statement in;
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
how to download a web-page in C++ (not display it)?
includeh10
|
|
|
|
|
WinInet
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/about_wininet.asp
also check out
http://www.mindcracker.com/mindcracker/c_cafe/wininet/wit0.asp
wWw.KruncherInc.cOm
|
|
|
|
|
It is wise reading the RFC for the HTTP protocol. rfc2616, a page can always be requested, it is just up to you if you want to "display" it or not.
michael
|
|
|
|
|
hi there!
there is very good article or you can say a Utility in Internet section of CP namly AmhttpSocket.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
What is this? -> uses undefined class
I have 2 dialod windows and I have add the dialog as a member variable like this
CDialog2 m_dialog;
This has work for a while but now I get this message;
'm_dialog' uses undefined class 'CDialog2'
This I get on the dialog1 Is there anyone that nows what it is?
|
|
|
|
|
CDialog1 doesn't know about CDialog2
You'll need to forward declare CDialog2 in the CDialog1 header
class CDialog2;
and then #include "CDialog2.h" in the CDialog1.cpp file.
Michael
CP Blog [^]
|
|
|
|
|
is there some thing similar to CWebBrowser2 in VC?
(except HtmlView).
thx
includeh10
|
|
|
|
|
I was recently looking at a piece of sample code to stop more than one instance of your app from being opened in which is uses a mutex along with your app's GUID. I know how to use the guid generator, but then what? Is a guid automatically generated for a regular mfc dialog app? if not and I create one, what do I do with it? How important is it for you to have a GUID for your app?
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
See This Link
http://www.codeproject.com/dialog/MessageMgmt.asp#GUIDGEN[^]
Quoted From The Link Above
"
But there is a way around it. There is a program which is part of the SDK, called GUIDGEN. What this program does is create a unique 128-bit binary value. Each time you create a new Globally Unique IDentifier, a GUID, you can be sure that it is really, truly, unique. It is not only unique for you, it is unique for everyone, everywhere, all the time. It incorporates the time and date, the MAC address from your network card (and if you don't have a network card, it uses another method, which has something like one chance in 263 of conflicting with another GUID), and a bunch of other information. Therefore, there is no way, short of explicit collusion between two programmers, that they will use the same GUID.
"
|
|
|
|
|
The reason the GUID is suggested is because they were creating a mutex and or other kernel object. The kernel object name space is shared among all processes on a system. So, using a STUPID name for a mutex like 'SingleInstance' is likely to get you into trouble later on when some other dolt uses the same name. If you name your mutex "MyNiftyApp_07DD65CCE50F46a09840D62B8DFD72C5", then the odds someone else could pick that name 'accidentally', by design, or just genetic cruelty, is extremely small.
|
|
|
|
|
this is more along the lines of what I was looking for. Thanks!!
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
I've seen this done before, I thought somewhere on this site, but I can't seem to find it. Can anyone point me in the right direction for putting a dialog into a static picturebox control? Any help is appreciated. Thanks
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
the static is usually used as a placeholder ( or a size and position reference ).
You simply need to create a modeless dialog and Create it in the parent dialog and place ( MoveWindow ) to fit the size of the placeholder.
One thing to remember is to disable the default ok and cancel behaviours so that you don't end up closing the child dialog while the parent dialog is still alive.
here's one example, here on CP :
an example
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
perfect! thanks
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|