Использование CeRapiInvoke() из rapi.dll #512793


#0 by AHgpuXa
Доброго времени суток. Стоит задача с ПК(win ХP) на КПК (win CE) установить время по ActiveSync. Использую FreePascal+Lazarus. Смотру в сторону rapi.dll и ее ф-ции CeRapiInvoke. Хочу вызвать SetLocalTime из Coredll.dll объявил функцию. function CeRapiInvoke(pDllPath: LPCWSTR; pFunctionName: LPCWSTR; cbInput: DWord; pInput: PByte; pcbOutput: PDWord; ppOutput: PPByte; ppIRAPIStream: PIRAPIStream; dwReserved: DWord): HResult; external 'rapi.dll'; Procedure SetPDATime; var localTime:TSystemTime; hr:HRESULT; DllPath,FunctionName:string; pDllPath,pFunctionName:LPCWSTR; cbInput: DWord; pInput: PByte; pcbOutput: PDWord; ppOutput: PPByte; ppIRAPIStream: PIRAPIStream; dwReserved: DWord; begin DllPath:='coredll.dll'; FunctionName:='SetLocalTime'; pDllPath:=@DllPath; pFunctionName:=@FunctionName; GetLocalTime(localTime); cbInput:=SizeOf(localTime); pInput:=@localTime; If not Rapi_Start(true) Then Exit; try hr:=CeRapiInvoke(pDllPath,pFunctionName,cbInput,pInput,pcbOutput,ppOutput,ppIRAPIStream,0); showmessage('Результат '+inttostr(hr)); except end; end; в результате возвращает -2147024809. Ткните носом плиз что я делаю не так. Может есть пример рабочий. Спасибо.
#1 by AHgpuXa
Неужели никто не сталкивался?
#2 by AHgpuXa
Все еще актуально.
#3 by МихаилМ
Вы форумом ошиблись
#4 by ДенисЧ
If RAPI services on the Windows Embedded CE-based device successfully locate and call the client function, then in Block Mode the return value is that which is returned on the Windows Embedded CE-based device by the called function. In Stream Mode, the return value is S_OK. If the function was not called successfully, or an exception occurred during its execution, an error code is returned. The CeGetLastError function can be used to get the error code, which takes the value set by pFunctionName, including the following values: HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND) The LoadLibrarypDllPath call failed on the device. HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER) The GetProcAddress of pFunctionName call on the device failed. HRESULT_FROM_WIN32(ERROR_EXCEPTION_IN_SERVICE) An exception occurred during execution of pFunctionName. Это ты проверил?
#5 by AHgpuXa
CEGetLastError возвращает 1064 ERROR_EXCEPTION_IN_SERVICE.
Тэги:
Ответить:
Комментарии доступны только авторизированным пользователям

В этой группе 1С