You are not logged in.

Duffy73

Trainee

  • "Duffy73" is male
  • "Duffy73" started this thread

Posts: 54

Location: Burgkirchen, Germany

  • Send private message

1

Thursday, April 21st 2005, 1:09pm

How to create a windows-service with qt

Hi!
How can I create a windows service using QT? The class qtservice doesn't exist in QT 3.3.4. can anybody help me or post a link?
Thx in advance!
Servus,
Duffy

zlatko

Professional

  • "zlatko" is male

Posts: 728

Location: Ukraine,Lviv

Occupation: programmer

  • Send private message

2

Thursday, April 21st 2005, 2:52pm

what actually do you mean under windows-services :rolleyes:
a life without programming its alike empty bottle 8)

Duffy73

Trainee

  • "Duffy73" is male
  • "Duffy73" started this thread

Posts: 54

Location: Burgkirchen, Germany

  • Send private message

3

Thursday, April 21st 2005, 3:06pm

I want my program to run as a service, e.g. when the PC ist rebootet but none logs in. don't u call this a "service"?
Servus,
Duffy

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

4

Thursday, April 21st 2005, 4:45pm

1. QtService is available for licencees (how do you write this word anyway?)
2. No, a service is something that serves something to someone :)
There is no direct support for windows services in Qt. You have to find how to implement such a service in C++ (it probably needs some registration of ports in the system, etc.) and then you can program its guts in Qt after wrapping it into the launching code.

Krasu

Intermediate

  • "Krasu" is male

Posts: 234

Location: Republic of Belarus

  • Send private message

5

Thursday, April 21st 2005, 5:01pm

RE: How to create a windows-service with qt

Hmm .. Which functions your service should povide ? Maybe, it will be easier to use WIN32 API ?

dimitri

Professional

  • "dimitri" is male

Posts: 1,311

Occupation: Engineer

  • Send private message

6

Thursday, April 21st 2005, 7:54pm

RE: How to create a windows-service with qt

If you have access to Qt 3.3.4 then you probably have access to Qt Solutions and QtService - unless you have Qt Professionnal or an evaluation version.

Duffy73

Trainee

  • "Duffy73" is male
  • "Duffy73" started this thread

Posts: 54

Location: Burgkirchen, Germany

  • Send private message

7

Thursday, April 21st 2005, 8:05pm

RE: How to create a windows-service with qt

all I had to do was to scroll down the page I had already looked at :-)...
Thank u and sorry...
Servus,
Duffy

stevey

Trainee

  • "stevey" is male

Posts: 58

Location: Australia

Occupation: Software developer

  • Send private message

8

Sunday, July 16th 2006, 7:12am

hey wysota

A "service" in windows IS in fact what Duffy described.
In linux it's a "daemon".

Enterprise Service Component (ESC) is another derivative which does bigger and bette stuff again.

Now, a Service in windows is a dll, and can be loaded directly into the Global Assembly Cache (GAC) then accessed from here at runtime and instantiated in a client application, or started at boot time.


Just thought an FYI may have been in order ;)

ferdna

Beginner

  • "ferdna" is male

Posts: 27

Location: USA

Occupation: Programming

  • Send private message

9

Wednesday, November 28th 2007, 11:56pm

this is what a windows service is... it is not related to .net (but you could create a .net service :-) )...

Introduction to Windows Service Applications

Microsoft Windows services, formerly known as NT services, enable you to create long-running executable applications that run in their own Windows sessions. These services can be automatically started when the computer boots, can be paused and restarted, and do not show any user interface. These features make services ideal for use on a server or whenever you need long-running functionality that does not interfere with other users who are working on the same computer. You can also run services in the security context of a specific user account that is different from the logged-on user or the default computer account. For more information about services and Windows sessions, see the About Services section in the Platform SDK documentation in the MSDN Library.


Reference:
http://msdn2.microsoft.com/en-us/library/d56de412(VS.80).aspx

also i would like to know if anyone here has a skeleton on a "NT service"?


thank you.
It Is Not That I'm Different! ... I'm Only Making The Difference!

stevey

Trainee

  • "stevey" is male

Posts: 58

Location: Australia

Occupation: Software developer

  • Send private message

10

Thursday, November 29th 2007, 2:20am

Yeah, a windows service created with .NET gets loaded into the GAC, but a stock standard NT service is a COM registered dll. I missed that in my previous post.

If you want to do it but don't have access to QtSolutions, then you'll have to do the whole thing manually. If you do and want to make your technique open and available to all, I'm sure many people would be grateful.

qtcurious

Beginner

  • "qtcurious" is male

Posts: 2

Occupation: Application Developer

  • Send private message

11

Wednesday, December 5th 2007, 4:41pm

Hi all,

I've just registered on this forum to find an answer to this same question.

Thanks to the link in one of the previous replies, here's the answer:

http://trolltech.com/products/qt/addon/s…ities/qtservice

Quote from the page:
"The QtService component is useful for developing Windows services and Unix daemons."

It looks like it's available for commercial customers only.

Or, can it be purchased separately? I'm not that familiar with Qt licensing scheme...

Thanks.

qtcurious

Beginner

  • "qtcurious" is male

Posts: 2

Occupation: Application Developer

  • Send private message

12

Wednesday, December 5th 2007, 4:50pm

Or, and BTW, there's a misunderstanding of what a windows service is for Windows.

I am a .NET developer (a Microsoft Certified Professional), so I dare think I know what I'm talking about... ;-)

On Windows, if you are using .NET, you can create a windows service in Visual Studio by creating a new project from a "Windows Service" template.
After all the coding is done (whatever you want your service to do...), the result of the project build is an executable (.exe).
It does not start/run as a "normal" app (by double-clicking on it). It has to be installed on the target machine using "installutil -i myservice.exe" command (or, an installer), and then you can run, pause, shutdown it by using admin utilities.
Most of the time, the services are configured so that they start automatically when the OS starts.
This is a VERY simplistic explanation, but... HTH.