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] dwFlags
Indicates which notifications to receive. Must contain a SIM Manager Init Constants value.
[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:
- SimInitialize()
- Other SIM Manager functions
- SimDeinitialize.
- Using these functions in any other sequence will produce errors.
Requirements
Header |
simmgr.h |
Library |
sim.lib |