result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION);
SysTryReturnResult(NID_LOC, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
- _UiBuilder* pBuilder = _UiBuilder::GetInstance();
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pBuilder, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = pBuilder->Parse(resourceId, this);
-
+ ClearLastResult();
+
+ // Parse UiBuilder XML file
+ _UiBuilder* pBuilder = new _UiBuilder();
+ if (pBuilder == null)
+ {
+ return E_OUT_OF_MEMORY;
+ }
+ pBuilder->Construct(resourceId, this);
+ r = pBuilder->Parse();
+
+ delete pBuilder;
return r;
}