Hello,
How can I create a Windows service using HMG?
Thanks,
Michael
Creating a Windows Service in HMG
Moderator: Rathinagiri
- apais
- Posts: 441
- Joined: Fri Aug 01, 2008 6:03 pm
- DBs Used: DBF, Leto, MariaDB, SQLite
- Location: uruguay
- Contact:
Re: Creating a Windows Service in HMG
A windows service by definition has no user interface.
So you don't need HGM to create it.
Harbour alone is enough for that.
HTH
Angel
So you don't need HGM to create it.
Harbour alone is enough for that.
HTH
Angel
Angel Pais
Web Apps consultant/architect/developer.
Web Apps consultant/architect/developer.
-
melliott42
- Posts: 119
- Joined: Wed Feb 18, 2009 2:14 pm
Re: Creating a Windows Service in HMG
That is great news - thanks Angel.
1. Are there any xHarbour examples of an app destined to be a service?
2. Are there any special initialization requirements?
3. How would a HMG\xHarbour program list or install itself as a service along with all the other common services?
I am a service creation newbie.
Thanks again,
Michael
1. Are there any xHarbour examples of an app destined to be a service?
2. Are there any special initialization requirements?
3. How would a HMG\xHarbour program list or install itself as a service along with all the other common services?
I am a service creation newbie.
Thanks again,
Michael
Re: Creating a Windows Service in HMG
If I remember, Grigori Filatov presented some apps working as service. Maybe he will answer?
Re: Creating a Windows Service in HMG
Hello Michael,melliott42 wrote:That is great news - thanks Angel.
1. Are there any xHarbour examples of an app destined to be a service?
2. Are there any special initialization requirements?
3. How would a HMG\xHarbour program list or install itself as a service along with all the other common services?
I am a service creation newbie.![]()
There is the following old sample service.prg in my code's collection (look at attachment).
Hope that helps but I don't tried this code because I've used a Harbour compiler
- Attachments
-
- service_pack.zip
- xHarbour example
- (4.55 KiB) Downloaded 422 times
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: Creating a Windows Service in HMG
Oh thanks for the code. I tried copying that into a new project file and replaced the Main.prg with everything in the service.prg file. Then I tried to compile it and got this in the error log:
hbmk2: Processing: spack.hbc
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
C:/hmg.3.0.35/PROJECTS/Spack/main.prg: In function 'ServiceExecutionThread':
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:351: warning: dereferencing 'void *' pointer
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:351: error: request for member 'pSymbol' in something not a structure or union
C:/hmg.3.0.35/PROJECTS/Spack/main.prg: In function 'AddToMessageLog':
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:441: warning: format '%d' expects type 'int', but argument 4 has type 'DWORD'
C:/hmg.3.0.35/PROJECTS/Spack/main.prg: In function 'GetLastErrorText':
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:692: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'DWORD'
hbmk2: Error: Running C compiler. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -O3 -Wall -W -IC:/hmg.3.0.35/harbour/include -IC:/hmg.3.0.35//include -IC:/hmg.3.0.35/PROJECTS/Spack -IC:/hmg.3.0.35/PROJECTS/Spack/ main.c C:\Users\Owner\AppData\Local\Temp\hbmk_5gj7u2.c
Has anyone had luck making a service?
Thanks...
hbmk2: Processing: spack.hbc
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
C:/hmg.3.0.35/PROJECTS/Spack/main.prg: In function 'ServiceExecutionThread':
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:351: warning: dereferencing 'void *' pointer
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:351: error: request for member 'pSymbol' in something not a structure or union
C:/hmg.3.0.35/PROJECTS/Spack/main.prg: In function 'AddToMessageLog':
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:441: warning: format '%d' expects type 'int', but argument 4 has type 'DWORD'
C:/hmg.3.0.35/PROJECTS/Spack/main.prg: In function 'GetLastErrorText':
C:/hmg.3.0.35/PROJECTS/Spack/main.prg:692: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'DWORD'
hbmk2: Error: Running C compiler. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -O3 -Wall -W -IC:/hmg.3.0.35/harbour/include -IC:/hmg.3.0.35//include -IC:/hmg.3.0.35/PROJECTS/Spack -IC:/hmg.3.0.35/PROJECTS/Spack/ main.c C:\Users\Owner\AppData\Local\Temp\hbmk_5gj7u2.c
Has anyone had luck making a service?
Thanks...
_________________
Sincerely,
Mike
Sincerely,
Mike