Tuesday, January 12, 2016
Background Services
I wrote a daemon, the daemon and call another dll.
After the service starts, the Services.exe where you can see two dll are running. But after some time, daemons normal, while the other is not in the dll Services.exe process space.
I do not know why?
Reply:
Resolved
Reply:
service program under WinCE can not function to start with RegisterService () function is registered, it can not use ActivateService ()
I have followed Microsoft's documentation write a very simple service program:
extern "C" DWORD PASCAL EXPORT XHW_Init (DWORD dwData)
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());
DWORD dwThreadID = 0;
CreateThread (NULL, 0, ProcThread, NULL, 0, & amp; dwThreadID);
dwData = 1;
return 1;
}
Other export functions are in accordance with Microsoft's example does not make any changes, but I RegisterService () return code 5 "access denied" error when registering service, I follow documented in the Registry Service Registry entries added as follows: < br />REGEDIT4
[HKEY_LOCAL_MACHINE \ Services \ XHWSVR]
"Order" = dword: 00000008
"Dll" = "XhwSvr.dll"
"Prefix" = "XHW"
"DisplayName" = "XHW Service"
"Description" = "XieHongWei's Service"
"IsEnabled" = dword: 00000001
"Keep" = dword: 00000001
"Index" = dword: 00000000
I would SmartPhone system after the restart with a ActivateService () function returns an error code to activate the service but 2 (file not found), as follows:
HANDLE hd = ActivateService (L "BTAGSVC", 0);
if (hd! = NULL)
{
AfxMessageBox (L "the successful launch of service");
}
else
{
TCHAR szBuf [80];
wsprintf (szBuf, L "Failed with error% d", GetLastError ());
AfxMessageBox (szBuf);
return FALSE;
}
I have a copy of "XhwSvr.dll" file to the "\ Windows" directory, and there is no way, I will "XhwSvr.dll" files are copied to the root directory of the system, but the problem remains the same, experts urged.
Reply:
I will dopod brush into Simplified Chinese system problem solving. Why Traditional Chinese for Windows Mobile 5.0 will not be able to register and start the services?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment