|
请教下用RIL来处理来电问题,想阻止系统接受RIL_NOTIFY_RING和RIL_NOTIFY_CALLERID有办法么,然后自己处理这几个消息
[复制链接]
请教下用RIL来处理来电问题,想阻止系统接受RIL_NOTIFY_RING和RIL_NOTIFY_CALLERID有办法么,然后自己处理这几个消息,并显示自己的来电界面.
我写了代码,但是执行不到回调函数里面,是什么原因呢,如果用RIL能实现上面的功能么?
代码如下:
typedef void (*PFVOID)();
typedef HRESULT (*PFRIL_Initialize)(DWORD dwIndex, PFVOID pfnResult, PFVOID pfnNotify, DWORD dwNotificationClasses, DWORD dwParam, HANDLE *hRil);
typedef HRESULT (*PFRIL_Deinitialize)(HANDLE hRil);
typedef HRESULT (*PFRIL_GetRegistrationStatus)(HANDLE hRil);
typedef HRESULT (*PFRIL_GetCellTowerInfo)(HANDLE hRil);
typedef HRESULT (*PFRIL_DevSpecific)(HANDLE hRil, BYTE*buf, int size);
PFRIL_Deinitialize RIL_Deinitialize;
PFRIL_Initialize RIL_Initialize;
PFRIL_GetRegistrationStatus RIL_GetRegistrationStatus;
PFRIL_GetCellTowerInfo RIL_GetCellTowerInfo;
PFRIL_DevSpecific RIL_DevSpecific;
fnInitRil()
{
m_hRilDll = LoadLibrary(L"ril.dll");
if (m_hRilDll)
{
RIL_Initialize= (PFRIL_Initialize)GetProcAddress(m_hRilDll,L"RIL_Initialize");
RIL_Deinitialize= (PFRIL_Deinitialize)GetProcAddress(m_hRilDll, L"RIL_Deinitialize");
RIL_GetRegistrationStatus= (PFRIL_GetRegistrationStatus)GetProcAddress(m_hRilDll, L"RIL_GetRegistrationStatus");
RIL_GetCellTowerInfo= (PFRIL_GetCellTowerInfo)GetProcAddress(m_hRilDll, L"RIL_GetCellTowerInfo");
RIL_DevSpecific= (PFRIL_DevSpecific)GetProcAddress(m_hRilDll, L"RIL_DevSpecific");
HRESULT hResult = 0;
hResult = RIL_Initialize(1, NULL, PFVOID(NotifyProc), -1, (DWORD)this, NULL);
GetLastError(); //retVal = TRUE;
}
}
LRESULT CALLBACK NotifyProc(DWORD dwCode, const void *lpData, DWORD cbData, DWORD dwParam)
{
switch(dwCode)
{
case RIL_NOTIFY_CONNECT:
break;
case RIL_NOTIFY_DISCONNECT:
break;
case RIL_NOTIFY_CALLERID:
break;
case RIL_NOTIFY_RING :
break;
case RIL_NOTIFY_CALLPROGRESSINFO:
break;
default:
break;
}
return 1;
}
执行不到NotifyProc回调函数里面,请问下
typedef HRESULT (*PFRIL_Initialize)(DWORD dwIndex, PFVOID pfnResult, PFVOID pfnNotify, DWORD dwNotificationClasses, DWORD dwParam, HANDLE *hRil);
我是用下面的这个弄的
RIL_Initialize(1, NULL, PFVOID(NotifyProc), -1, (DWORD)this, NULL)
里面的参数如何定义呢?还是其他的问题呢??
|
|