Click here to Skip to main content
16,004,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCPropertyPage and OnWizardBack Pin
Brigg Thorp20-Jun-05 4:56
Brigg Thorp20-Jun-05 4:56 
GeneralRe: CPropertyPage and OnWizardBack Pin
Mike Dimmick20-Jun-05 5:00
Mike Dimmick20-Jun-05 5:00 
GeneralRe: CPropertyPage and OnWizardBack Pin
Brigg Thorp20-Jun-05 5:02
Brigg Thorp20-Jun-05 5:02 
GeneralRe: CPropertyPage and OnWizardBack Pin
Rage20-Jun-05 6:06
professionalRage20-Jun-05 6:06 
GeneralRe: CPropertyPage and OnWizardBack Pin
Brigg Thorp20-Jun-05 7:52
Brigg Thorp20-Jun-05 7:52 
QuestionCFileFind allocates memory but does not release it? Pin
ryuki20-Jun-05 4:55
ryuki20-Jun-05 4:55 
AnswerRe: CFileFind allocates memory but does not release it? Pin
David Crow20-Jun-05 5:16
David Crow20-Jun-05 5:16 
Generalbut what is with SHGetFileInfo? Pin
ryuki20-Jun-05 14:12
ryuki20-Jun-05 14:12 
I work under Win98 and use the systemmonitor for viewing allocated memory. Its not easy to say but there seems to be more to the memory issue than expected. I managed to find another source of consuming memory. It is a little part including SHGetFileInfo. And that small codebit causes much more trouble than all other together. It seems that SHGetFileInfo allocates memory too. But you can't see it at the systemmonitor. It eats all of it with time and at a single point I can't create threads anymore or some functions like StretchDIBits doesn't work properly because there is no memory anymore. I get a lot of "Not enough memory" errors allthough all ressourceviewers say there are more than 100 MB of free memory still there.

I can give you the small code example:

<br />
SHFILEINFO sfi;<br />
UINT       uFlags = SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME | SHGFI_ICON | SHGFI_SMALLICON;<br />
if ( SHGetFileInfo ( tmp, 0, &sfi, sizeof(SHFILEINFO), uFlags ))<br />
	m_ctrPathFrom->InsertItem ( npos, sfi.szDisplayName, sfi.iIcon );<br />


Thats all. I looked at the documentation but it says nothing about freeing the structure or something. Does someone know what to do?

And you can be believe me, i traced the cause of the memory issue to that single if-line.

I hope someone can help.
GeneralRe: but what is with SHGetFileInfo? Pin
PJ Arends20-Jun-05 16:39
professionalPJ Arends20-Jun-05 16:39 
GeneralRe: but what is with SHGetFileInfo? Pin
ryuki20-Jun-05 22:33
ryuki20-Jun-05 22:33 
GeneralRe: but what is with SHGetFileInfo? Pin
David Crow21-Jun-05 2:26
David Crow21-Jun-05 2:26 
GeneralFile monitoring Pin
LCI20-Jun-05 3:54
LCI20-Jun-05 3:54 
GeneralRe: File monitoring Pin
Alexander M.,20-Jun-05 4:05
Alexander M.,20-Jun-05 4:05 
GeneralRe: File monitoring Pin
Blake Miller20-Jun-05 4:26
Blake Miller20-Jun-05 4:26 
GeneralRe: File monitoring Pin
LCI20-Jun-05 4:30
LCI20-Jun-05 4:30 
GeneralRe: File monitoring Pin
Blake Miller20-Jun-05 4:31
Blake Miller20-Jun-05 4:31 
GeneralRe: File monitoring Pin
LCI20-Jun-05 4:37
LCI20-Jun-05 4:37 
GeneralRe: File monitoring Pin
David Crow20-Jun-05 5:18
David Crow20-Jun-05 5:18 
GeneralString manipulation in a win 32 dll Pin
LCI20-Jun-05 3:48
LCI20-Jun-05 3:48 
GeneralRe: String manipulation in a win 32 dll Pin
Chris Losinger20-Jun-05 4:22
professionalChris Losinger20-Jun-05 4:22 
GeneralRe: String manipulation in a win 32 dll Pin
LCI20-Jun-05 4:34
LCI20-Jun-05 4:34 
GeneralRe: String manipulation in a win 32 dll Pin
Chris Losinger20-Jun-05 4:39
professionalChris Losinger20-Jun-05 4:39 
GeneralRe: String manipulation in a win 32 dll Pin
LCI20-Jun-05 6:05
LCI20-Jun-05 6:05 
GeneralPossible to use a C++ .lib in C# Pin
anderslundsgard20-Jun-05 3:20
anderslundsgard20-Jun-05 3:20 
GeneralRe: Possible to use a C++ .lib in C# Pin
Alexander M.,20-Jun-05 3:24
Alexander M.,20-Jun-05 3:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.