PDA

View Full Version : QtService start problem visual studio 2010



matteo.ceruti
29th December 2011, 17:40
Hi,
I use QtService and QtServiceController classes.
To start the service I use the function start() of QtServiceController and it runs without problem with visual studio 2008.
The problem is with Visual Studio 2010. The lpServiceController->start() doesn't run.
bool QtServiceController::start(const QStringList &args)
{
Q_D(QtServiceController);
bool result = false;
if (!winServiceInit())
return result;

// Open the Service Control Manager
SC_HANDLE hSCM = pOpenSCManager(0, 0, SC_MANAGER_CONNECT);
if (hSCM) {
// Try to open the service
SC_HANDLE hService = pOpenService(hSCM,(wchar_t *)d->serviceName.utf16(), SERVICE_START);
....
hService in Visual Studio 2010 is null, in 2008 is ok.

Suggestions?

Thanks
Teo

raj_iv
24th December 2012, 09:11
same problem with me...Any solution after one year??

ChrisW67
24th December 2012, 09:22
This is a Windows API call failing. To get extended error information, call GetLastError.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms684330%28v=vs.85%29.aspx