StiCreateInstance

[This is preliminary documentation and subject to change.]

The StiCreateInstance function is used to obtain a pointer to the IStillImage interface. All other Still Image functions are called through the pointer obtained from this function. Calling this function can be done instead of calling CoCreateInstance and Initialize.

HRESULT StiCreateInstance(
  HINSTANCE hinst,
  DWORD dwVer,
  PSTI *ppSti,
  LPUNKNOWN punkOuter
);
 

Parameters

hinst
Instance handle to the application or DLL that is creating the IStillImage object.

STI uses this value to determine whether the application or DLL has been certified.

dwVer
Version number of the Sti.h header file that was used. This value must be STI_VERSION. STI uses this value to determine for what version of STI the application or DLL was designed.
ppSti
Pointer to a pointer to the IStillImage interface. This is an output parameter. When the function returns, this parameter contains a pointer to an IStillImage interface if the function is successful.
punkOuter
Pointer to controlling unknown for COM aggregation, or 0 if the interface is not aggregated. Most callers will pass 0.

Note  If aggregation is requested, the object returned in *ppSti is a pointer to an IUnknown rather than an ISti, as required by COM aggregation.

Return Values

If the function succeeds, the return value is S_OK.

If the function fails, the return value is the appropriate COM error.

Remarks

Calling this function with punkOuter = NULL is equivalent to creating the object with CoCreateInstance(&CLSID_Sti, punkOuter, CLSCTX_INPROC_SERVER, &IID_ISti, ppSti); then initializing it with Initialize.

Calling this function with punkOuter != NULL is equivalent to creating the object with CoCreateInstance(&CLSID_Sti, punkOuter, CLSCTX_INPROC_SERVER, &IID_IUnknown, ppSti). The aggregated object must be initialized manually.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in sti.h.
  Import Library: Included as a resource in sti.dll.

See Also

Still Image Overview, Making An Application Still Image-Aware