Directory Services


The IDsAdminCreateObj::CreateModal method displays the object creation wizard and returns the newly created object. The IDsAdminCreateObj::Initialize method must be called before IDsAdminCreateObj::CreateModal can be called.

HRESULT CreateModal( 
  HWND hwndParent,
  IADs** ppADsObj


[in] Contains the window handle of the owner of the wizard. This value cannot be NULL. Use the result of the GetDesktopWindow function if no parent window is available.
[out] Pointer to an IADs interface pointer that receives the newly created object. This parameter recevies NULL if the object creation wizard fails or is cancelled. The caller must release this interface when it is no longer required. This parameter may be NULL if this object is not required.

Return Values

Returns an OLE-defined error code or one of the following values.

The object creation wizard was successful.
The object creation wizard was cancelled by the user. If ppADsObj is not NULL, ppADsObj receives a NULL value.
hwndParent is invalid or IDsAdminCreateObj::Initialize has not been called.
A memory allocation failure occurred.


If the user cancels the object creation wizard, this method returns S_FALSE. If ppADsObj is not NULL, ppADsObj receives a NULL value. Because of this, the use of the SUCCEEDED macro to determine if ppADsObj is valid should be avoided. Always test the contents of ppADsObj for a non-NULL value before using the interface pointer.


Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Header: Declared in Dsadmin.h.

See Also

IDsAdminCreateObj, IDsAdminCreateObj::Initialize, GetDesktopWindow, IADs, SUCCEEDED