Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
GeneralRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
Member 1367430012-Feb-18 6:51
Member 1367430012-Feb-18 6:51 
GeneralRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
Gerry Schmitz12-Feb-18 6:59
mveGerry Schmitz12-Feb-18 6:59 
AnswerRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
#realJSOP13-Feb-18 2:05
mve#realJSOP13-Feb-18 2:05 
QuestionStreamwriter only writes one item from textbox Pin
auting8212-Feb-18 2:34
auting8212-Feb-18 2:34 
AnswerRe: Streamwriter only writes one item from textbox Pin
Richard MacCutchan12-Feb-18 5:59
mveRichard MacCutchan12-Feb-18 5:59 
GeneralRe: Streamwriter only writes one item from textbox Pin
auting8212-Feb-18 8:29
auting8212-Feb-18 8:29 
GeneralRe: Streamwriter only writes one item from textbox Pin
Richard MacCutchan12-Feb-18 8:40
mveRichard MacCutchan12-Feb-18 8:40 
AnswerRe: Streamwriter only writes one item from textbox Pin
Gerry Schmitz12-Feb-18 6:44
mveGerry Schmitz12-Feb-18 6:44 
GeneralRe: Streamwriter only writes one item from textbox Pin
auting8212-Feb-18 12:49
auting8212-Feb-18 12:49 
GeneralRe: Streamwriter only writes one item from textbox Pin
Gerry Schmitz12-Feb-18 13:10
mveGerry Schmitz12-Feb-18 13:10 
GeneralRe: Streamwriter only writes one item from textbox Pin
auting8212-Feb-18 13:37
auting8212-Feb-18 13:37 
GeneralRe: Streamwriter only writes one item from textbox Pin
Gerry Schmitz12-Feb-18 14:06
mveGerry Schmitz12-Feb-18 14:06 
Questionchange of status Pin
Member 1363217112-Feb-18 2:18
Member 1363217112-Feb-18 2:18 
AnswerRe: change of status Pin
Gerry Schmitz12-Feb-18 6:49
mveGerry Schmitz12-Feb-18 6:49 
AnswerRe: change of status Pin
Richard Deeming12-Feb-18 8:49
mveRichard Deeming12-Feb-18 8:49 
GeneralRe: change of status Pin
Member 1363217112-Feb-18 19:19
Member 1363217112-Feb-18 19:19 
GeneralRe: change of status Pin
Richard Deeming12-Feb-18 22:31
mveRichard Deeming12-Feb-18 22:31 
QuestionHow to manage dinamically generated user controls? Pin
alin111-Feb-18 13:12
alin111-Feb-18 13:12 
AnswerRe: How to manage dinamically generated user controls? Pin
Dave Kreskowiak11-Feb-18 17:29
mveDave Kreskowiak11-Feb-18 17:29 
AnswerRe: How to manage dinamically generated user controls? Pin
OriginalGriff11-Feb-18 20:15
mveOriginalGriff11-Feb-18 20:15 
GeneralRe: How to manage dinamically generated user controls? Pin
BillWoodruff11-Feb-18 22:52
professionalBillWoodruff11-Feb-18 22:52 
GeneralRe: How to manage dinamically generated user controls? Pin
OriginalGriff11-Feb-18 23:06
mveOriginalGriff11-Feb-18 23:06 
Hi Bill!
Thanks for that. It does if you call the bool version (which I didn't know), but it doesn't if you call "vanilla" Dispose:
C#
void IDisposable.Dispose() {
    if (hBitmapDC.Handle == IntPtr.Zero || hMetafileDC.Handle == IntPtr.Zero || hBitmap.Handle == IntPtr.Zero) {
        return;
    }

    bool success;

    try {
        success = DICopy(hMetafileDC, hBitmapDC, destRect, true);
        Debug.Assert(success, "DICopy() failed.");
        SafeNativeMethods.SelectObject(hBitmapDC, hOriginalBmp);
        success = SafeNativeMethods.DeleteObject(hBitmap);
        Debug.Assert(success, "DeleteObject() failed.");
        success = UnsafeNativeMethods.DeleteCompatibleDC(hBitmapDC);
        Debug.Assert(success, "DeleteObject() failed.");
    }
    finally {

        // Dispose is done. Set all the handles to IntPtr.Zero so this way the Dispose method executes only once.
        hBitmapDC = NativeMethods.NullHandleRef;
        hBitmap = NativeMethods.NullHandleRef;
        hOriginalBmp = NativeMethods.NullHandleRef;

        GC.SuppressFinalize(this);
    }
}

Reference Source[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: How to manage dinamically generated user controls? Pin
BillWoodruff12-Feb-18 0:24
professionalBillWoodruff12-Feb-18 0:24 
GeneralRe: How to manage dinamically generated user controls? Pin
OriginalGriff12-Feb-18 0:37
mveOriginalGriff12-Feb-18 0:37 
GeneralRe: How to manage dinamically generated user controls? Pin
BillWoodruff12-Feb-18 2:00
professionalBillWoodruff12-Feb-18 2:00 

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.