Click here to Skip to main content
15,921,052 members
Home / Discussions / C#
   

C#

 
GeneralRe: function usage in a .config file Pin
RB@Emphasys19-Jul-04 9:48
RB@Emphasys19-Jul-04 9:48 
GeneralApplicationException VS Exception Pin
Gimpy198319-Jul-04 5:00
Gimpy198319-Jul-04 5:00 
GeneralRe: ApplicationException VS Exception Pin
Heath Stewart19-Jul-04 5:30
protectorHeath Stewart19-Jul-04 5:30 
GeneralCalled but not executed :confused: Pin
Gimpy198319-Jul-04 4:54
Gimpy198319-Jul-04 4:54 
GeneralRe: Called but not executed :confused: Pin
Heath Stewart19-Jul-04 5:35
protectorHeath Stewart19-Jul-04 5:35 
GeneralRe: Called but not executed :confused: Pin
Gimpy198319-Jul-04 9:27
Gimpy198319-Jul-04 9:27 
GeneralRe: Called but not executed :confused: Pin
Heath Stewart19-Jul-04 9:32
protectorHeath Stewart19-Jul-04 9:32 
GeneralGoing Unmanaged doesn't free Memory Pin
Guilio karadanais19-Jul-04 4:24
Guilio karadanais19-Jul-04 4:24 
I've got a memory issue with an unmanaged call to GDI.

I've followed the CreateDC, releaseDC, DeleteDC step outlined in the platform SDK,these methods all return true or 1, indicating that they succeeded. However after each call to the method it consumes 3 mb of RAM and does not release the memory, the issue is that method will be called many times and builds up to about 60mb memory used.

I store a bitmap in a member variable, which i dispose of.

iWidth = nWidth;
iHeight = nHeight;
hdcSrc = User32.GetWindowDC(User32.GetDesktopWindow());
hdcDest = GDI32.CreateCompatibleDC(hdcSrc);
hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc,iWidth,iHeight);
image = new Bitmap(iWidth,iHeight);

GDI32.SelectObject(hdcDest,hBitmap);
GDI32.BitBlt(hdcDest,0,0,iWidth,iHeight,hdcSrc,iStartX,iStartY,SRCCOPY);
image = Image.FromHbitmap(new IntPtr(hBitmap));

User32.ReleaseDC(User32.GetDesktopWindow(),hdcSrc);
GDI32.DeleteDC(hdcDest);
GDI32.DeleteObject(hBitmap);

if I call GC.Collect() it clears the memory and brings it back down but this is oviously not a good idea.

Any Idea's?

GeneralRe: Going Unmanaged doesn't free Memory Pin
Heath Stewart19-Jul-04 4:37
protectorHeath Stewart19-Jul-04 4:37 
GeneralRe: Going Unmanaged doesn't free Memory Pin
Guilio karadanais19-Jul-04 5:07
Guilio karadanais19-Jul-04 5:07 
GeneralHex to Dec conversion (big numbas!) Pin
Blubbo19-Jul-04 4:06
Blubbo19-Jul-04 4:06 
GeneralRe: Hex to Dec conversion (big numbas!) Pin
Heath Stewart19-Jul-04 4:30
protectorHeath Stewart19-Jul-04 4:30 
GeneralEAP Certificate requests... Pin
Vodstok19-Jul-04 4:03
Vodstok19-Jul-04 4:03 
GeneralRe: EAP Certificate requests... Pin
Heath Stewart19-Jul-04 4:42
protectorHeath Stewart19-Jul-04 4:42 
GeneralRegular Expressions Pin
Anonymous19-Jul-04 3:54
Anonymous19-Jul-04 3:54 
Questionhow do I get the cursor position?? Pin
Stephan Wright19-Jul-04 1:31
Stephan Wright19-Jul-04 1:31 
AnswerRe: how do I get the cursor position?? Pin
misterbear19-Jul-04 2:07
misterbear19-Jul-04 2:07 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 2:19
Stephan Wright19-Jul-04 2:19 
GeneralRe: how do I get the cursor position?? Pin
Heath Stewart19-Jul-04 3:18
protectorHeath Stewart19-Jul-04 3:18 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 3:53
Stephan Wright19-Jul-04 3:53 
Questionhow to get the supported cryptographic algorithm on current .net platform Pin
noosword18-Jul-04 23:54
noosword18-Jul-04 23:54 
AnswerRe: how to get the supported cryptographic algorithm on current .net platform Pin
Heath Stewart19-Jul-04 2:39
protectorHeath Stewart19-Jul-04 2:39 
GeneralQuestion abt service Pin
SatyaDY18-Jul-04 23:51
SatyaDY18-Jul-04 23:51 
GeneralRe: Question abt service Pin
RB@Emphasys19-Jul-04 6:44
RB@Emphasys19-Jul-04 6:44 
GeneralReferences controls created at runtime Pin
JKtracksub418-Jul-04 21:41
JKtracksub418-Jul-04 21:41 

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.