//------------------------------------------------------------------------------ // _ExecuteThreadProc // // Create a new thread to show a message box //------------------------------------------------------------------------------ DWORD WINAPI _ExecuteThreadProc( __in LPVOID pVoid ) { HRESULT hr = S_OK; WCHAR szTitle[MAX_PATH] = {0}; DllIncLockCount(); if( NULL == LoadString( g_hInstance, IDS_ContextMenu_Title, szTitle, ARRAYSIZE(szTitle)) ) { hr = HRESULT_FROM_WIN32(GetLastError()); } // // Show a message box // if( S_OK == hr ) { MessageBox( NULL, reinterpret_cast<PWSTR>(pVoid), szTitle, MB_OK ); } CoTaskMemFree( pVoid ); DllDecLockCount(); return 0; }// _ExecuteThreadProc
//------------------------------------------------------------------------------ // CSimpleThermostatService::CSimpleThermostatService (Constructor) //------------------------------------------------------------------------------ CSimpleThermostatService::CSimpleThermostatService(): m_cRef(1), m_lDesiredTemp(0), m_pTypeInfo(NULL), m_pUnkStdDispatch(NULL) { DllIncLockCount(); // // Prep the random number generater // srand( (unsigned)time( NULL ) ); rand(); // // Since this is a virtual thermostat, a random number is generated // for the current temperature. // m_lCurrentTemp = RAND100(); }
//------------------------------------------------------------------------------ // CDeviceContextMenu::CDeviceContextMenu (Constructor) //------------------------------------------------------------------------------ CDeviceContextMenu::CDeviceContextMenu(): m_cRef(1), m_szCommandName(NULL) { DllIncLockCount(); }
//------------------------------------------------------------------------------ // CDevicePropertyPage::CDevicePropertyPage (Constructor) //------------------------------------------------------------------------------ CDevicePropertyPage::CDevicePropertyPage(): m_cRef(1), m_pShellItem(NULL) { DllIncLockCount(); }
//------------------------------------------------------------------------------ // CSimpleThermostatDevice::CSimpleThermostatDevice (Constructor) //------------------------------------------------------------------------------ CSimpleThermostatDevice::CSimpleThermostatDevice(): m_cRef(1), m_pCSimpleThermostatService(NULL) { DllIncLockCount(); }
//------------------------------------------------------------------------------ // PrinterServiceProvider::PrinterServiceProvider (Constructor) //------------------------------------------------------------------------------ CPrinterServiceProvider::CPrinterServiceProvider() : m_cRef(1) { DllIncLockCount(); }