Office 2013 and later

Creates an object that a client can access in a preferred character format.

Exported by:


Called by:


Implemented by:


HRESULT HrCreateNewWrappedObject( 
    LPVOID        pvUnwrapped, 
    ULONG         ulUnwrappedFlags, 
    ULONG         ulWrappedFlags, 
    const IID     *pIID, 
    const ULONG   *pulReserved, 
    BOOL          fCheckWrap, 
    LPVOID       *ppvWrapped 


[in] The initial unwrapped Outlook object. Must implement one of the following interfaces:


[in] Flags that characterize the unwrapped initial object. Must be one or more of the following values:

  • DDLWRAP_FLAG_ANSI—Unwrapped object is ANSI.

  • DDLWRAP_FLAG_UNICODE—Unwrapped object is UNICODE.


[in] Flags for the preferred character format. Must be one or more of the following values:

  • DDLWRAP_FLAG_ANSI—Wrapped object will be exposed as ANSI.

  • DDLWRAP_FLAG_UNICODE—Wrapped object will be exposed as UNICODE.


[in] The identifier of the interface supported by the unwrapped object; set it to NULL if this is unknown.


[in] This parameter is not used. It must be NULL.


[in] Set this parameter to true if pvUnwrapped should be checked for its format before wrapping; set it to false if the object should be wrapped without checking.


[out] A pointer to the requested object, wrapped in the requested character format.

S_OK if the call succeeded; otherwise, an error code.

Passing in a wrapped object with fCheckWrap set to true will result in an unwrapped object. Regardless of whether or not the returned object is wrapped, the client is responsible for releasing the reference on the returned object.

When using GetProcAddress to look for the address of this function in msmapi32.dll, specify HrCreateNewWrappedObject@28 as the procedure name.