fixed for VS2008 and WinCE

This commit is contained in:
Günter Obiltschnig 2015-03-14 10:30:22 +01:00
parent e1694c3e68
commit 39b6c79e46
2 changed files with 6 additions and 6 deletions

View File

@ -168,15 +168,15 @@ protected:
void defineOptions(OptionSet& options);
#endif
#if defined(POCO_OS_FAMILY_WINDOWS)
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE)
static HDEVNOTIFY registerServiceDeviceNotification(LPVOID filter, DWORD flags);
/// Registers the ServerApplication to receive SERVICE_CONTROL_DEVICEEVENT
/// events.
/// events via handleDeviceEvent().
virtual DWORD handleDeviceEvent(DWORD event_type, LPVOID event_data);
/// Handles the SERVICE_CONTROL_DEVICEEVENT event. The default
/// implementation does nothing and returns ERROR_CALL_NOT_IMPLEMENTED.
#endif // if defined(POCO_OS_FAMILY_WINDOWS)
#endif
private:
#if defined(POCO_VXWORKS)

View File

@ -147,7 +147,7 @@ DWORD ServerApplication::handleDeviceEvent(DWORD /*event_type*/, LPVOID /*event_
DWORD ServerApplication::ServiceControlHandler(DWORD control, DWORD event_type, LPVOID event_data, LPVOID context)
{
DWORD result = NO_ERROR;
auto instance = reinterpret_cast<ServerApplication*>(context);
ServerApplication* pThis = reinterpret_cast<ServerApplication*>(context);
switch (control)
{
@ -159,9 +159,9 @@ DWORD ServerApplication::ServiceControlHandler(DWORD control, DWORD event_type,
case SERVICE_CONTROL_INTERROGATE:
break;
case SERVICE_CONTROL_DEVICEEVENT:
if (instance)
if (pThis)
{
result = instance->handleDeviceEvent(event_type, event_data);
result = pThis->handleDeviceEvent(event_type, event_data);
}
break;
}