Export (0) Print
Expand All

StiCreateInstance function

The StiCreateInstance function is used to obtain a pointer to the IStillImage interface. All other Still Image methods are called through the pointer obtained from this function. Calling this function is similar to calling the standard COM CoCreateInstance and CoInitialize functions.

Syntax


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

Parameters

hinst [in]

Instance handle to the application or DLL that creates the IStillImage object.

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

dwVer [in]

Version number of the Sti.h header file that was used. This value must be STI_VERSION. Still Image uses this value to determine for what version of STI the application or DLL was designed.

ppSti [out]

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 [in]

Pointer to the controlling IUnknown interface of the COM aggregate object, or NULL if the interface is not aggregated. Most callers pass NULL. See the section on Aggregation in Component Services for more information.

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

Return value

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 similar to creating the object with CoCreateInstance (&CLSID_Sti, punkOuter, CLSCTX_INPROC_SERVER, &IID_IStillImage, ppSti); then initializing it with CoInitialize.

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

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Sti.h

Library

Sti.lib

DLL

Sti.dll

Unicode and ANSI names

StiCreateInstanceW (Unicode) and StiCreateInstanceA (ANSI)

See also

About Still Image
Making an Application Still Image-Aware

 

 

Community Additions

ADD
Show:
© 2015 Microsoft