M
Marauderz
Someone please suggest a nice source for me to read up on InterOp'ing,
Marshalling, and P/Invoking. Before that though... I'm trying to access
the SIM Manager APIs and in my short test program I decided to just
initialize and deinitialize the SIMManager with the following code
The native functions involved are :-
HRESULT SimInitialize (
DWORD dwFlags,
SIMCALLBACK lpfnCallBack,
DWORD dwParam,
LPHSIM lphSim
);
HRESULT SimDeinitialize (
HSIM hSim
);
which I've defined in VB.Net as
<DllImport("cellcore.dll")> _
Function SimInitialize(ByVal flags As Int32, ByVal callBack As Int32, _
ByVal callBackParam As Int32, ByRef lpSim As Integer) As Int32
End Function
<DllImport("cellcore.dll")> _
Function SimDeinitialize(ByVal hSim As Integer) As Int32
End Function
-----
And this is my little test code.
Dim oSim As New SIMManager
Dim hSim As Integer
Dim hResults As Integer
hResults = oSim.SimInitialize(0, 0, 0, hSim)
hResults=oSim.SimDeinitialize(hSim)
I get a value in hSim after the call to initialize... but when I call
SimDeinitialized I got an unsupported exception.. =P The first 3 parameters
are 0 (or NULL right?) cause I do not require SIM callbacks.
Any help guys? Or can someone just point me to a SIMManager wrapper that has
already been made cause all I need is something to read the Phonebook
entries, don't even need to write to it.
Thanks Guys,
Marauderz.
Marshalling, and P/Invoking. Before that though... I'm trying to access
the SIM Manager APIs and in my short test program I decided to just
initialize and deinitialize the SIMManager with the following code
The native functions involved are :-
HRESULT SimInitialize (
DWORD dwFlags,
SIMCALLBACK lpfnCallBack,
DWORD dwParam,
LPHSIM lphSim
);
HRESULT SimDeinitialize (
HSIM hSim
);
which I've defined in VB.Net as
<DllImport("cellcore.dll")> _
Function SimInitialize(ByVal flags As Int32, ByVal callBack As Int32, _
ByVal callBackParam As Int32, ByRef lpSim As Integer) As Int32
End Function
<DllImport("cellcore.dll")> _
Function SimDeinitialize(ByVal hSim As Integer) As Int32
End Function
-----
And this is my little test code.
Dim oSim As New SIMManager
Dim hSim As Integer
Dim hResults As Integer
hResults = oSim.SimInitialize(0, 0, 0, hSim)
hResults=oSim.SimDeinitialize(hSim)
I get a value in hSim after the call to initialize... but when I call
SimDeinitialized I got an unsupported exception.. =P The first 3 parameters
are 0 (or NULL right?) cause I do not require SIM callbacks.
Any help guys? Or can someone just point me to a SIMManager wrapper that has
already been made cause all I need is something to read the Phonebook
entries, don't even need to write to it.
Thanks Guys,
Marauderz.