OriginObject::Unlock

Description

Unlocks a locked object for read/write data access. Unlock will remove protection completely, regardless of the type of locking. (Implemented only for WorksheetLayer, WorksheetPage, and Project Objects)

Syntax

BOOL Unlock( LPCSTR lpcszPassword, DWORD dwCtrl = 0 )

Parameters

lpcszPassword
Desired password to unlock later
dwCtrl
not used, must be 0

Return

returns non zero if successfull else 0;

Examples

EX1

void wksunlock(string strPass = "CP")
{
    Worksheet wks = Project.ActiveLayer();
    DWORD dwBits = 0;
    if(wks)
    {
        wks.Unlock(strPass, dwBits);
        printf("Worksheet %s is unlocked\n", wks.GetName());
    }
}

Remark

See Also

OriginObject::Lock, OriginObject::GetLock

header to Include

origin.h