Lock
Locks a particular object from read/write data access (Implemented only for WorksheetLayer, WorksheetPage, and Project Objects)
BOOL Lock( LPCSTR lpcszPassword, DWORD dwCtrl )
returns non zero if successfull else 0;
EX1
void wkslock(string strPass = "CP", bool bHideData = false) { Worksheet wks = Project.ActiveLayer(); DWORD dwBits = PLC_WRITE; if(wks) { if(bHideData) dwBits |= PLC_READ; wks.Lock(strPass, dwBits); printf("Worksheet %s is locked\n", wks.GetName()); } }
EX2
void wkslock_rename(bool bLock=true) { Worksheet wks = Project.ActiveLayer(); if(wks) { int nn = 0; if( bLock ) wks.Lock(NULL, PLC_RENAME); else wks.Unlock(NULL, 0); } }
OriginObject::GetLock, OriginObject::Unlock
origin.h