Deletes the object passed.
Syntax
ESS_FUNC_M EssOtlDeleteObject (hOutline, objHandle)
Parameter | Data Type | Description |
---|---|---|
hOutline | ESS_HOUTLINE_T | Outline handle (Edit mode only) |
objHandle | ESS_HOBJECT_T | Object to be deleted |
Notes
You cannot delete objects with existing associations. With Text List objects (SmartList objects), you cannot delete the SmartList object without removing references—use the Get Object References API to do so.
Return Value
Returns:
0—If successful
Error number—If unsuccessful
Example
void TestCreateObject()
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_HOUTLINE_T hOutline = ESS_NULL;
ESS_OBJDEF_T Object;
ESS_OBJECT_TYPES objType;
ESS_STR_T smartListName;
ESS_HOBJECT_T ObjHandle;
ESS_ULONG_T Count, i;
ESS_PHOBJECT_T ObjHandles;
ESS_HOBJECT_T hObjHandle;
ESS_HSMARTLIST_T hSmartList;
ESS_STR_T objName;
memset(&Object, '\0', sizeof(Object));
Object.hCtx = hCtx;
Object.ObjType = ESS_OBJTYPE_OUTLINE;
Object.AppName = szAppName;
Object.DbName = szDbName;
Object.FileName = szFileName;
/* Open outline */
sts = EssOtlOpenOutline(hCtx, &Object,
ESS_TRUE, ESS_TRUE, &hOutline);
/* Create a static SmartList */
objType = OBJECT_SMARTLIST;
smartListName = "SList1";
sts = EssOtlCreateObject(hOutline, objType,
smartListName, &ObjHandle);
/* List all SmartList objects */
objType = OBJECT_SMARTLIST;
sts = EssOtlListObjects(hOutline, objType,
&Count, &ObjHandles);
/* Save */
SaveOutline(hOutline);
/* Find objects */
objName = "SList1";
sts = EssOtlFindObject(hOutline, objType, objName,
&hObjHandle);
/* Delete objects */
hSmartList = (ESS_HSMARTLIST_T)hObjHandle;
sts = EssOtlDeleteObject(hOutline, hSmartList);
SaveOutline(hOutline);
if(ObjHandles)
EssFree (hInst, ObjHandles);
/* Unlock objects */
sts = EssUnlockObject(hCtx, Object.ObjType,
Object.AppName, Object.DbName, Object.FileName);
/* Close outline */
sts = EssOtlCloseOutline(hOutline);
}
See Also