WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStFactory class reference

CloneObject

Call this method to clone a widget created with CreateWidget.

Ole declaration

VARIANT_BOOL CloneObjectByName(LPCTSTR sObjectName, LPCTSTR sObjectCloneName);

VARIANT_BOOL CloneObjectById(SHORT usObjectId, SHORT usObjectCloneId);

Parameters
sObjectName
The name of the widget that will be cloned.
usObjectId
The id of the widget that will be cloned.
sObjectCloneName
The name of the widget's clone.
usObjectCloneId
The id of the widget's clone.
Return Value

On success, CloneObject returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Remarks

Only visible widgets can be cloned. Invisible widgets, such as the Function Keys controller, can't be cloned.

Example
C#
using WirelessStudioOleWidgets;
WStFactory oFactory = new WStFactory();
oFactory.CreateWidgetBy((short)WSTFactoryConstants.WS_LINE, 33, "MyLine", 15, 15, 30, 30, "");
oFactory.CloneObjectById(33,44);
See also

CreateWidget | WStForm::AddObject | CreateForm

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference