ServiceFB - Event-driven NT Service framework

User projects written in or related to FreeBASIC.
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

ServiceFB - Event-driven NT Service framework

Postby zerospeed » Oct 02, 2006 1:07

Hello FB users!,

ServiceFB simplify programmers work when creating NT Services using FreeBASIC as programming language. It also encapsulate most of the Win32 API and provide a clean event-driven like interface.

UPDATES

* 2007-02-12 - Version 0.3.0 is released!
*0.3.0* (February 12, 2007)

* ServiceFB is now under MIT license.

* No log file (service.log) will be created unless SERVICEFB_DEBUG_LOG is defined.
That will trim a bit the reported information


README: here
CHANGELOG: here

Downloads:
Version 0.3.0 (Source): servicefb-0.3.0.zip (36Kb)

Licensing:
ServiceFB is now licensed under MIT license. You could use ServiceFB in free or commercial projects as long copyright notice remain unchanged.

SVN Access:
ServiceFB is now at Google Code!

This project is hosted in a public, open SVN (subversion) repository, in case others want to contribute or get updates using it.

NOTES
* It takes advantage of features available in beta 0.17 of FreeBASIC (tested only agaisnt night-build from Pritchard).
* Also, its build with fb lang (no deprecated) so your code must comply with the new standards.

Feedback welcome,

Zero
Last edited by zerospeed on Feb 13, 2007 13:50, edited 3 times in total.
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

Postby zerospeed » Oct 04, 2006 12:11

New Update!

Until management and simulation of services arrive, a few improvements were added into the repository:

* More detailed documentation about using the library

* Reimplemented the way fb.svc handles services, allowing now multiple services run from the same process.

* Implemented ServiceHost: handling of multiple services from the same process (shared). Refer to sample/multiservice.bas



All these changes are avaible at the same URL: OpenSVN Repository

Version 0.2 will be released soon after management code is checked in.

Feedback and suggestions are welcome.

Regards,

Zero
v1ctor
Site Admin
Posts: 3795
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Postby v1ctor » Oct 04, 2006 14:36

Well done, i remember playing with SCM years ago, in assembly :).

I was checking the rake script too, it looks much more logical compared to make, gotta evaluate it soon - not for the FB sources though.
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

Postby zerospeed » Oct 04, 2006 16:49

v1ctor wrote:Well done, i remember playing with SCM years ago, in assembly :).

I was checking the rake script too, it looks much more logical compared to make, gotta evaluate it soon - not for the FB sources though.


Thank you for your comment v1ctor, and for being the first one! ;-)

Rake is a powerful 'make' used by ruby, and you could see the flexible it could get :-)

I'm going to improve the ProjectTask syntax used in the Rakefile (the source for the code is in rakehelp/freebasic).

I hope get a syntax similar to this:

Code: Select all

# for executables (no need for extension)
project_task 'my_service' do
  executable  'my_long_executable_name'
  #library     'my_lib_name'
  #dynlib      'my_dll_so_name'
  target_path 'bin'
 
  version     '1.0.1'
 
  main        'my_service/main.bas'
  source      'a_module_file.bas', 'another_module.bas'
  source      'several_other_files.bas'
 
  # also could use source wildcard!
  source      'src/**/*.bas'
 
  library     'user32', 'advapi32'
end


this create a few tasks:
my_service:build, clobber and rebuild

build compile only the files needed to be compiled, and will recompile the ones changed. clobber will clear the compiled versions of the files and rebuild perform the both actions in chain for a clean compilation (clobber, build)

Also, it add a global build/rebuild/clobber tasks that do everything for all the projects defined in the Rakefile.

Is more cleanner than ' ProjectTask.new (...) do |p| ' syntax :D
(and more easy to understand than make :P

OTOH, what do you think about the layout, naming convention and implementation?
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

Postby zerospeed » Oct 06, 2006 17:26

OK, instead of 'hopes' the new syntax for Rakefile is available:

Code: Select all

project_task 'myprogram' do
  executable  'MyProgram'
  build_to    'bin'

  main        "src/main.bas"
  source      "src/module1.bas", "src/module2.bas", "src/module3.bas"
 
  lib_path    'lib'
  library     'mylib'
  library     'user32'
end


As usual, for the one interested in this Ruby-make (Rake) check the code from OpenSVN Repository rakehelp subdirectory of trunk.
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

Postby zerospeed » Oct 17, 2006 1:50

UPDATE:

Now on SVN repo, revision 18:

* Added automatic loading of definitions (include file) for ServiceFB Utils namespace
Use #define SERVICEFB_INCLUDE_UTILS
Also must link with ServiceFB_Utils.bas

* Coded console mode for debugging and testing of services (one or many)
Please check the source files in samples folder.


Checkin management code soon, so release 0.2 of ServiceFB is near!
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

Postby zerospeed » Oct 19, 2006 20:05

Version 0.2 is out!

Updated the first post with new information and download link!

Please, take a look there and post your comments.

Later,

Zero
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Oct 20, 2006 3:56

Cool ^^
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

Postby zerospeed » Feb 13, 2007 13:51

Hello Forum!

ServiceFB made some progress (0.3.0 version) and home moving to Google Code!

Also code is now MIT License compatible, you could could feel safe using it ;-)

Please refer to the first post for detailed information about it.

Don't hesitate on leave comments and suggestions.

Zero
vkthakur
Posts: 7
Joined: Jan 07, 2009 4:05
Location: India
Contact:

Re: ServiceFB - Event-driven NT Service framework

Postby vkthakur » Apr 20, 2016 13:53

Hi guys I've updated to the latest version of FB now its giving this error in compiling ServiceFb code. Please let me know how to fix this. Now I'm using FB after a while here is the compiler error

_internals.bi(20) error 3: Expected End-of-Line, found 'constructor' in 'declare sub _initialize() constructor'
_internals.bi(21) error 3: Expected End-of-Line, found 'destructor' in 'declare sub _terminate() destructor'
vdecampo
Posts: 2980
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Re: ServiceFB - Event-driven NT Service framework

Postby vdecampo » Apr 20, 2016 14:04

Constructor/Destructor are reserved words. Looks like there should be a remark symbol (') before the words.

-Vince
Tourist Trap
Posts: 2197
Joined: Jun 02, 2015 16:24

Re: ServiceFB - Event-driven NT Service framework

Postby Tourist Trap » Apr 20, 2016 14:21

Didn't know about module constructors.
Last edited by Tourist Trap on Apr 20, 2016 17:27, edited 1 time in total.
fxm
Posts: 7488
Joined: Apr 22, 2009 12:46
Location: Paris suburb, FRANCE

Re: ServiceFB - Event-driven NT Service framework

Postby fxm » Apr 20, 2016 16:36

Module constructor must be declared only at the definition level (not at the declaration level):

Code: Select all

declare sub _initialize()

sub _initialize() constructor
  '.....
end sub

Corrected in version 1.00.0:
- #726: CONSTRUCTOR|DESTRUCTOR (module-level initialization/cleanup) was allowed to be specified on sub prototypes (although, it was ignored), method bodies (silently miscompiled due to the missing THIS argument), and PRIVATE/PROTECTED static member procedures. Now these cases are disallowed.
zerospeed
Posts: 227
Joined: Nov 04, 2005 15:29

Re: ServiceFB - Event-driven NT Service framework

Postby zerospeed » Apr 20, 2016 18:21

ServiceFB hasn't been updated in years and don't think is worth to update all that codebase.

After the shutdown of Google Code, you can find the code on GitHub:

https://github.com/luislavena/servicefb

However I recommend using something smaller like mini_service instead:

https://github.com/luislavena/mini_service

But that also requires updates to latest version.

Free free to send a pull request with changes.

Cheers.
vkthakur
Posts: 7
Joined: Jan 07, 2009 4:05
Location: India
Contact:

Re: ServiceFB - Event-driven NT Service framework

Postby vkthakur » Apr 21, 2016 14:27

thanx 4 quick reply guys. I think now I should go with mini service...

Return to “Projects”

Who is online

Users browsing this forum: Bing [Bot] and 0 guests