Detach
Return internal hDC value of class and set internal hDC to NULL
HDC Detach( )
Returns TRUE for success or FALSE for failure.
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; }
origin.h