|
Call the CheckPoint() method of a CMemoryState object where you want to start tracking. At the point where you want to stop tracking, call the CheckPoint() method of a second CMemoryState object. Then, call the Difference() method of a third CMemoryState object, passing to it the other two CMemoryState objects.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I know how to use the functions, I want to know where is the best place to call them in the App.
I was calling the oldState.Checkpoint() in the App() and
newState.Checkpoint() in App::ExitInstance() but it returned a difference.
When I called oldState.Checkpoint() it listed (I think) a CDocTemplateManager object and a CSingleDoctemplate object.......
So this is obviously not the best place to call oldState.DumpAllObjectsSince() to check overall memory usage.
Is there a function after App::ExitInstance to do the difference check in?
|
|
|
|
|
Generally speaking, in a DEBUG build you'll get this behaviour anyway providing your CPP files have the '#define new ....' stuff in them.
Are you calling CheckPoint before or after calling the base ExitInstance()?
Steve S
|
|
|
|
|
I don't know what you mean by '#define new..."
I'm overriding the MFCApp::ExitInstance() function and calling the base ExitInstance(). Then I do the object dump, so I can't see why a few objects are still allocated.
BTW I am extremely paranoid about memory leaks after having lots of trouble with my last PC (crashing.......sloooowdown etc..)
|
|
|
|
|
I need to link to this lib ws2_32.lib, and would like to know how to do this in the project->settings->link tab.
What exactly do I type in, and where in the project->options text box in the link tab?
Thanks,
ns
|
|
|
|
|
ns wrote:
I need to link to this lib ws2_32.lib, and would like to know how to do this in the project->settings->link tab.
Enter ws2_32.lib in the Object/library modules box.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Appreciate the speedy response
Thanks,
ns
|
|
|
|
|
#pragma comment(lib, "ws2_32.lib") also does the trick
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi
I am creating a project (base in a single document), I modified the initial class *View(at the end of the wizard) to be based in CFormView, so that the project is like one based on dialogs (but with other classes and format).
I set up a tabcontrol in the window, and I want to get the other frames because nothing appears in the tab.
I made some other examples but as this one is based on other classes, I have no idea how to get the information.
Can anybody help?
Thanks
rubencmos@hotmail.com
rubencmos@hotmail.com
|
|
|
|
|
This should get you started:
http://msdn.microsoft.com/msdnmag/issues/0600/wicked/default.aspx
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I really apreciate that.
Thanks so much that was really what I was looking for.
Thanks again. Ruben
|
|
|
|
|
I see that given an ftp site, you can use CInternetSession, CFTPConnection with
char* ftpserver = "ftp.microsoft.com" for e.g.
So if I have instead an IP adress for a computer, how do I get the CString for the fptserver.
Basically I need to download some data files off a given IP adress programmatically. Any suggestions appreciated.
Thanks,
ns
|
|
|
|
|
See this project in sourceforge.net
http://sourceforge.net/projects/filezilla/
You can download the source from this URL.
|
|
|
|
|
See this project in sourceforge.net
http://sourceforge.net/projects/filezilla/
You can download the source from this URL.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
hello everybody,
I want create a listbox dynamically on the click of a button in a dialog box.
i had used the following code then also it is not visible when ever i click a button
CListBox clb;
clb.Create(LBS_SORT,CRect(10,10,100,150),this,123);
this->Invalidate(TRUE);
even i had commented the last line then also it was not visible.
thank you.
|
|
|
|
|
You need more styles than just LBS_SORT, like, for instance WS_CHILD and WS_VISIBLE, although the latter can be done by clb.ShowWindow(SW_SHOWNA).
Steve S
|
|
|
|
|
You need more styles than just LBS_SORT . Add to that:
WS_CHILDWINDOW<br />
WS_VISIBLE
While not required, you might also need:
WS_TABSTOP<br />
LBS_NOTIFY<br />
LBS_SORT<br />
LBS_NOINTEGRALHEIGHT
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I presume the problem is not with window styles. You are creating the CListBox control object within the local scope. The object will get deleted once the program control exits the function. So try something like this:
CListBox m_pclb; //In header ( .h file )
In .CPP
m_pclb->Create(WS_VISIBLE | LBS_SORT,CRect(10,10,100,150),this,123);
this->Invalidate(TRUE);
This should work!!!
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Good catch!
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I have a small application that doesn't use MFC, but i'd like to alter the listbox's so each item can be displayed in it's own colour.
I've searched these forums and google, but can't find any reference to non-mfc code to do this ... there is plenty of mfc stuff around though.
Hoping someone will know of a resource/example i can look at, else i'll have to convert the app to MFC.
ScorpioMidget
|
|
|
|
|
|
Many thanks for the link, should have tried msdn myself
ScorpioMidget
|
|
|
|
|
I'm making a mfc dialog app and was wondering if this type of program can access a seperate file. I was hopping for the user to be able to input data (mainly text) while the mfc dialog app was running, be able to save it in some type of file, and then retrieve it at a later date. I'm new to mfc, any help would be great, if possible please state which functions need to be used to create/retrieve the data or where they can be found on the internet. Thank you.
|
|
|
|
|
http://msdn.microsoft.com[^]
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Anonymous wrote:
...if possible please state which functions need to be used to create/retrieve the data or where they can be found on the internet.
It sounds like you'll need to use a CStdioFile object for reading from and writing to a text file. Google the Internet for tons of examples. MSDN has plenty, too.
CStdioFile file("mainly.txt", CFile::modeCreate | CFile::modeWrite);
file.WriteString("This is some text that the user entered\n");
...
CString strText;
file.ReadString(strText);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|