DeviceContext::Detach

Description

Return internal hDC value of class and set internal hDC to NULL

Syntax

HDC Detach( )

Parameters

Return

Returns TRUE for success or FALSE for failure.

Examples

EX1

int    DeviceContext_Detach_ex1()
{
    Page pb;
    pb = Project.Pages(); // Get the project's active page
    if( pb.IsValid() )
    {
        string strName = pb.GetName();
        HDC hdc = (HDC)&strName;
        ASSERT(hdc);
        DeviceContext myDC ;
        bool bRet = myDC.Attach(hdc);

        HDC hdc1 = myDC.Detach();
    }
    return 0;
}

Remark

See Also

header to Include

origin.h