Link against: hswidgetpublisher.lib
#include <hsexception.h>
ObserverClass* dataObserver = new ObserverClass(); try { HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); if ( hsPublisher ) { HsWidget& widget = hsPublisher->createHsWidget( "templateName", "widgetName", "uniqueIdentifier" ); //attempt to create the widget again (with the same information) //will cause an exception hsPublisher->createHsWidget( "templateName", "widgetName", "uniqueIdentifier" ); } } catch (HsException& exception) { int errReason = exception.getReason(); //if the exception is thrown, becasue the widget attempted to //be created already exists the errReason will be KErrAlreadyExists }
Public Member Functions | |
IMPORT_C | HsException (int aLeaveCode) |
Constructor of the HsException. | |
virtual IMPORT_C | ~HsException () |
Destructor of the HsException. | |
IMPORT_C int | getReason () |
Method retrieves the error information contained in the excpetion object. |
|
Constructor of the HsException. |
|
Destructor of the HsException. |
|
Method retrieves the error information contained in the excpetion object. ObserverClass* dataObserver = new ObserverClass(); try { HsWidgetPublisher* hsPublisher = new HsWidgetPublisher(dataObserver); hsPublisher->createHsWidget( "templateName", "widgetName", "uniqueIdentifier" ); } catch (HsException& exception) { int errReason = exception.getReason(); }
|