|
But is it true that reusing Memory context object does not cause any memory leak.
Thanx in advance
Einstein's Assistant
|
|
|
|
|
Yes, that is also true, so long as you manage it's state effectively. Either way, the point is that this is not your problem in this case.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Hi,
I am still unable to pin down the source of memory leak. If I upload my source code can u help me to solve the memory leak problem.
Thanx a lot in advance.
Einstein's Assistant
|
|
|
|
|
Of course. Reask the question as a new post, so others see it too, in case I don't spot the problem.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Hi again,
I uploaded my whole application in yahoo's briefcase. Please go through it and help me spot the source of memory leak.
Thanks in advance.
userid : moswal0071
password : cooldude
Einstein's Assistant
|
|
|
|
|
Finally I got my .Net copy today, after 2 hours of installation and woohooooo I'm using .Net!
But wait, cannot create a VC++ project, "VC package is unavailable or not registered.", I guess that's because my old VC++ 6.0 is still on this machine, so I removed VC++6.0 and REINSTALLED .Net, there went another 2 hours(who cares since I don't have school today), now it's working!
I spent a little time to play with the new VC++ IDE, it's cool and all, but I quickly found something different.
The first thing is that I cannot assign "const" keyword to member functions when I create them using "Add->Member function", I have to add "const" keyword manually to both header file and cpp file after the member functions have been created, which sounds awkward to me.
Another thing, it's no big deal but still makes me somewhat annoying. In VC++ 6.0 we can delete a function by right-clicking on the function name(on "Class view") and selecting "delete", it will automatically remove the function definition in header file and comment implementation out in cpp file, very convenient, now this feature is gone, or that I cannot find it existing.
If anyone know how to solve those problem in .Net VC++ IDE please let me know. Thanks.
|
|
|
|
|
You are better off adding things by hand anyhow - they were probably removed because the wizards that did them were notorious for stuffing up.
I don't even use a wizard to add interfaces to an ATL object - I like to do it by hand and know exactly what is going where. The ATL wizard is notorious for dying half way through and leaving fragments throughout a project.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
how can i stop my application from freezing when its processing a function?
any help will be greatful. Thanks.
|
|
|
|
|
put it inside a thread... look up CreateThread on Platform SDK or check out one of the system sections on CP
- Roman -
|
|
|
|
|
got any examples on CreateThread?;P
|
|
|
|
|
You should rather use _beginthread[ex]. Look in MSDN for example.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I am facing two problems:
1) displaying and scaling image files of *.TIFF, *.BMP, *.JPG formats
2) conversion of grayscale images into bitonal representations (smaller size, better compression).
Does anyone know about any cool open source graphics libraries, algorithms, etc...
Thanks a bunch in advance.
Kirill
|
|
|
|
|
Hi,
Try this url. It gives you all the information that u need. In fact the whole application does exactly what u want.
http://www.codeguru.com/bitmap/CPicture.html
I suggest you use GDI+ libraries. They are really to use and you can save,load and modify the images much more easily compared to the method used by the author of CPicture class.
Einstein's Assistant
|
|
|
|
|
I've done a series of articles on image processing in GDI+ which will tell you everything you need to know, here on CP.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
I am trying to dynamically size the column widths of a MSFlexGrid control. Presently, the code I'm using is this (which was hard enough to figure out):
CDC * dc;
dc = this->GetDC();
dc->SetMapMode( MM_TWIPS );
CRect rc;
m_TheGrid.GetClientRect( &rc );
dc->DPtoLP(&rc);
int Width = rc.Width() / (CellsPerRow + 1);
m_TheGrid.SetColWidth(1, Width );
Width = m_TheGrid.GetColWidth(1);
for ( int i=1; i < CellsPerRow+1; i++ )
{
m_TheGrid.SetColWidth(i, Width );
}
int Remainder = rc.Width() - Width * CellsPerRow;
m_TheGrid.SetColWidth(0, Remainder );
What I've noticed is that even though I set a particular size like this:
m_TheGrid.SetColWidth(1, 332);
the size read via GetColWidth() is usually something different, like 330. That isn't too much of a problem, since I set one column, read what was actually set, then set all the columns (except the first one) to that value. I then account for errors by putting the remaining size into the first column.
BUT:
The size that is returned by the GetClientRect() call does not encompass the entire space available. That is, when I've got all my columns layed out, I still have stubstantial space available on the right.
I was halfway expecting to have LESS room because of a scroll bar. But the size reported by GetClientRect() underreports.
Does anyone have an idea about what is happening here?
I don't think it should matter, but I've set the font in this control to fixedsys.
Ron
|
|
|
|
|
Hi,
given:
CStringArray* pArray;
CStringArray aArray;
and I have useful data in pArray. Now I want to accumulate multiple pArray's in an aArray.
aArray.Append(pArray)
but the argument of CStringArray::Append requires a CStringArray& not a CStringArray*.
How can I cast it?
Thank you
R.
|
|
|
|
|
aArray.Append(*pArray)
-c
Cheap oil. It's worth it!
|
|
|
|
|
|
"A duplicate insert block exists for class "CMainFrame" in the source files"
I get this error message when I open up the classwizard for CMAinFrame class. Any information?
|
|
|
|
|
Looks like you have //{{AFX.. comments which clas wizard uses duplicated in your header or source files. Search for these and remove them.
|
|
|
|
|
I have a MDI application where I want to have only one open document at any given time. There are several different types of views, so it therefore gets confusing with many open documents as well.
So, thanks to a helpfull CPian I eventually managed to block OnFileOpen() and OnFileNew() if a file is already open. But the MRU list is still active. How can I disable it if I don't want it to show up?
Haakon S.
|
|
|
|
|
Change the call to LoadStdProfileSettings() in your application's initialisation function to LoadStdProfileSettings(0).
Regards,
Jason Wilden.
|
|
|
|
|
Thank you for pointing in the right direction. But I'm not entirly happy with your proposal. I want to retain the MRU list if no file is open, and to disable it only when there is an open file. Calling LoadStdProfileSettings(0) will do away with the MRU list altogether.
Anyway, I've discovered that there is something called CRecentFileList::UpdateFileList(). I'll do some scruteny here.
Regards, Haakon S.
|
|
|
|
|
You could also delete it from the menu in the resource editor.
Best regards,
Alexandru Savescu
|
|
|
|
|
To eliminate the menu items, simply remove the ID_FILE_OPEN, ID_FILE_NEW and ID_FILE_MRU_FILE1 menu items from the the menu associated with you document template, but leave them in the default menu IDR_MAINFRAME (which is used when no document is active). You will also need to add a pair of ON_UPDATE_COMMAND_UI() handlers to your CDocument derived class to disable the ID_FILE_OPEN and ID_FILE_NEW commands when a document is active (this will prevent them being invoked via toolbar buttons or accelerator keys). When no document is active, you'll get the default behaviour (they will be enabled, since a handler function is defined).
Stephen C. Steel
Kerr Vayne Systems Ltd.
|
|
|
|