This function is used to configure the callback function
void SetNetworkEventCallback(
tpfnCallback pfn
);
Parameters
pfn
Pointer to function of type tpfnCallback. This function will receive all Telephony events and parameters send from the DynRIL dll
Return values
None.
Remarks
The Callback type is defined as:
typedef void (*tpfnCallback)(DWORD dwEvent,LPVOID lpvParam,DWORD cbParam);
This function is used to provide processing for any messages received from the Network Component.
Sample
// Our phone callback func
void PhoneCallback(DWORD dwEvent,LPVOID lpvParam,DWORD cbParam)
{
switch (dwEvent)
{
case NETWORK_EVENT_CALL_IN:
{
TCHAR szNumber[255]={0};
for (unsigned int i=0;i<cbParam;i++) szNumber[i] = (TCHAR)(((char *)lpvParam)[i]);
// process the incoming phone number
...
}
break;
...
...
// Application entry point
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// Load the RIL Library
if (LoadDynRILDll(TEXT("\\DynRILDll.dll")) != ERROR_SUCCESS) {
MessageBox(0, TEXT("Cannot load DynRILDll.dll . Try to reinstall this sample."), TEXT(""), MB_ICONERROR);
return 0;
}
DebugMode(1);
// Init the Library network component
if (NetworkInit() != ERROR_SUCCESS) {
UnloadDynRILDll();
MessageBox(0, TEXT("Error using the network, does this device have a phone module?"), TEXT(""), MB_ICONERROR);
return 0;
}
// Set callback for events
SetNetworkEventCallback((tpfnCallback)PhoneCallback);
...
NetworkDeinit();
UnloadDynRILDll();
...
Requirements
OS Versions: Windows CE 1.0 and later.
Header: dynril.h.
Dll Library: dynrildll.dll.