//定义
#ifdef PhoneBookData_EXPORTS
#define PhoneBookData_API __declspec(dllexport)
#else
#define PhoneBookData_API __declspec(dllimport)
#endif
PhoneBookData_API int Invoke_GetSIMNumber(DWORD cbInput, BYTE* pInput,
DWORD* pcbOutput, BYTE** ppOutput,
IRAPIStream* pStream);
//调用
LPCWSTR pDllPath = L"PhoneBookData.dll";
LPCWSTR pFunctionName = L"Invoke_GetSIMNumber";
DWORD cbOut;
BYTE* pOut;
// HRESULT hr;
HRESULT hr = CeRapiInit();
//GetSIMNumber(INT16 iIndex, char * cNumber, INT16 NumberMaxLength);
BYTE *pInput = (BYTE*)LocalAlloc(LPTR,sizeof(INPUT_PARAM_FOR_API1));
((INPUT_PARAM_FOR_API1 *)pInput)->iIndex = 10;
((INPUT_PARAM_FOR_API1 *)pInput)->NumberMaxLength = 20;
hr=CeRapiInvoke(pDllPath,
pFunctionName,
sizeof(INPUT_PARAM_FOR_API1),
pInput,
&cbOut,
&pOut,
NULL,
0);
if (cbOut==sizeof(WCHAR)*21 && hr==UT_OK)
MessageBox("Invoke successful",MB_OK);
else
MessageBox("Invoke error",MB_OK);
if(pOut)
LocalFree(pOut);
怎么试来试去都是E_FAIL,郁闷啊!小弟新手,望高手给点意见!