Partager via


SimInitialize (Compact 2013)

3/26/2014

This function must be called by applications in order to use any of the functions in this API. Passing in a function callback is required for applications that wish to obtain notifications.

Syntax

HRESULT SimInitialize (
  DWORD dwFlags,
  SIMCALLBACK lpfnCallBack,
  DWORD dwParam,
  LPHSIM lphSim
);

Parameters

  • [in] lpfnCallBack
    Function callback for notifications.

    NULL if notifications are not specified in dwFlags.

  • [in] dwParam
    Parameter to pass to each notification function call.

    Zero (0) if notifications are not specified in dwFlags.

  • [out] lphSim
    A pointer to an HSIM handle to use on subsequent function calls.

Return Value

HRESULT is S_OK for success, or one of the SIM_E error constants defined in the SIM Manager Error Constants table.

Example

HRESULT    hr;
HSIM       hSim;

hr = SimInitialize( SIM_INIT_NONE, NULL, 0, &hSim );

// SIM Manager operations go here

// Finished using the SIM Manager
hr = SimDeinitialize( hSim );

Remarks

Code Division Multiple Access (CDMA) devices do not contain SIM cards, and are not supported by SIM Manager. Therefore, on CDMA radios, SimInitialize returns SIM_E_NOSIM and lphSim = NULL. The rest of the SIM APIs cannot be used because they require the lphSim value.

This function must be used as a pair with the SimDeinitialize function. You must use them in the sequence:

  1. SimInitialize()
  2. Other SIM Manager functions
  3. SimDeinitialize.
  4. Using these functions in any other sequence will produce errors.

Requirements

Header

simmgr.h

Library

sim.lib

See Also

Reference

SIM Manager Functions
SimDeinitialize
SIMCALLBACK