domingo, 14 de julio de 2013

FastReport is Back !!!! Hand in hand with Xailer !!!!!

FastReport step into the (x)Harbour world through Sergey Spirin, a brilliant russian programmer, who wrote a complete (x)Harbour interface based on FastResport's OLE support, available for the most of the programming languages.

When you purchased FastReport for (x)Harbour to Sergey, he gave you a class for (x)Harbour along with its source code, a .CH header file, and a DLL generated by himself (You can buy the FastReport's source code, so you can rebuild the DLL as many times as you want). The DLL had all the FastReport report designer self-contained (curious fact: ALL FastReport, including the Visual Report Designer, Preview module and the 11 export engines, are contained in a single DLL of only 4 Mbytes size, no installation procedure or registration is needed to use the report designer, just copy the DLL where your EXE is, and you are done), with the stuff given by Sergey you were ready to use all the power of the report designer in your (x)Harbour programs, including applications written for console mode, or with the most popular GUIs for (x)Harbour such Xailer itself, FiveWin and Harbour MiniGUI.

Sergey may got tired of selling copies and copies of FastReport for (x)Harbour, we at CiberTec, translated the Sergey's manual into Spanish, and we sold several copies of the product. Unfortunally and because such is life, about one year ago, without a notice, Sergey passed the way, leaving a widow and a lot of orphan programmers with no support, and with the hope of new, more powerful versions of the report designer and the promise of been able to use other products of the FastReport family with (x)Harbour.

FastReport has had such a big impact in the (x)Harbour comunity, specially in the Xailer comunity (the most of the Xailer programmers I know use FastReport, only a few don't) and that is why the Xailer Team decided to go into the Sergey's project, giving a new life to this great product that some of us thought it was dead for the (x)Harbour world. So, Xailer signed a patnership contract with FastReport to develop an interface for (x)Harbour, and retake Sergey's project, giving to it new power, Xailer now is "FastReport's associated developer"

Once signed the agreement with Alexander Tzyganenko, FastReport's CTO, the Xailer Team went into the job, first reviewing Sergey's work, as mentioned before it was based on the OLE connection, and even doing so, the thign works and works well, is not a good idea to make it this way, because you are adding and extra layer of communication that the program doesn't really need. Due to this the Xailer Team decided make direct calls to the functions contained in the DLL, getting more speed accesing the reports.

An additional advantage of making direct calls to the DLL instead of doing by OLE, is that you have full access to other functions not accesible via OLE because they are not "published" to be used by this technology, this allowed the Xailer Team to get access to ALL the power of FastReport, features that only were available through other languages such Delphi, because the FastReport version used with (x)Harbour is the same used by Delphi as a VCL (Visual Control Library) in Ignacio Ortiz de Zuñiga own words.... "we went deep into the FastReport internals and now we are able to make incredible things with the report generator"

The new release of FastReport for (x)Harbour, improved the data access, specially in master / detail / subdetail / sub-sub detail operations and as Ignacio told me once ...."it all seems that Sergey didn't know how to use the SET RELATION command, he made a mess to set up a master/detail report" with the new version of FastReport adapted by Xailer Team is easier the access to DBF data files, but also, and knowing that every day less programmers use DBF tables and use SQL databases, the new release of FastReport for (x)Harbour includes full support for Xailer's DataSets.

It's well known that many (x)Harbour developers use FastReport for the daily reporting basics, so in this new release, the Xailer Team have tried to keep compatibility with all the work made by Sergey, because it would be a pitty to change the working methodology that all of us have been using until now to get access to FastReport features, but also many functions have been enhaced to improve the access to the report designer internals from Xailer, special attention was put in calling your own functions in your Xailer EXE from FastReports, Sergey used a function called CallHBFunc(), in the new release you can call directly the function contained inside the EXE, not need to use other stuff.

One "complain" or "concernt" of the programmer, is that Sergey's project stoped his work in FastReport's version 4.7.92.  The new version developed by the Xailer team works perfectly with the most recent release,  version 4.14.3  this is a warranty that your future applications will work with the most recent version of the VCL of FastReport.
But.... It's correct to call this version "FastReport for (x)Harbour" ?, may be not, because the Xailer Team has made a great job making FastReport to work in first place with Xailer's IDE, in fact, FastReport will only work with version 3.1 of Xailer (we will talk about this new exciting Xailer release in a future article). A new tab has been included in the Xailer IDE to support FastReport, the same way it is made in Delphi and in .NET.

This new release has special attention in DataSets support, for DBF, ADS, SQL and Array datasets. I have included a little sample of FasReport for Xailer (the right name), you will notice that this sample is dentical to the one used in Delphi, but this is full written in Xailer 3.1, it uses all kinds of DataSets, includes source code, 60 different reports in FR3 format and a version demo of the DLL of FastReport:

One of my favourite features in this new release of Xailer and FastReport is that you don't need to have an external .XML file with the translation of the report generator messages, now you can include inside a Xailer EXE the file with the messages, another great feature of Xailer 3.1 (soon to be reviewed) is tha hability to include inside the EXE also all the reports in .FR3 format, so you don't need to use individual files for your reports.

Ok, it's clear, there is a new FastReport for Xailer version, and works pretty good, but.... What if I don't use Xailer ?, What if I use FiveWin, MiniGUI, Visual xHarbour or (x)Harbour in console mode ?, well BY THE MOMENT you won't be able to use this new version because has been designed to work only with Xailer and even if you have Xailer you can only use it with Xailer 3.1, however I have talked with Ignacio and he has told me for sure that will be a "generic" version to be used with (x)Habour and all its GUIs but "in the future", by now, there's no a date to release this generic version, but, thinking it better, and after all, the Xailer Team has been done the dirty work: To make FastReport compatible with Xailer and of course, with (x)Harbour.
So far, so good, and now you probably be thinking.... How much is going to cost this new version of FastReport ?, well, as far as I know, the agreement signed between Xailer and FastReport forces Xailer to distribute a legal copy of FastReport with any version of FastRepot for Xailer sold, however, this will not increase the price of the product for the programmer, FastReport for Xailer sells for 300 Euro, same price Sergey used to take, for this money you get an original licence of FastReport distributed directly from the vendor company, and the component for Xailer (or for [x]Harbour when released) will be obtained from Xailer.

Yet another question.... What if I bought my FastReport for (x)Harbour with Sergey ? Will I have right to upgrade or something like that to use this new version ?, I don't really know, I have been told that current FastReport for (x)Harbour users would qualify for a 100 Euro rebate from the original price with a proof of purchase or any other way of validation of a FastReport licence. There are A LOT of illegal copies of FastReport around and there's no way to know if you purchased a copy with Sergey since there's no registration of these operations.

Anyway, FastReport is the right choice for reporting with (x)Harbour, the report generator is GREAT, personally I have been playing with the FastReport HTML exportation module and Xailer, I've recompiled this old sample with the new Xailer 3.1 and here is how it looks:

Using Xailer and FastReport for web reporting

Does it worth the wait ?,  you bet on it ! This new release of FastReport has many bug fixes from the version used by Sergey and the implementation made by the Xailer Team let you to make things that were complicated or imposible to do, so worth the wait this new release.

miércoles, 28 de enero de 2009

How did you sleep ? - 1

Impressing my admired writter Germán Dehesa I'm going to lend his article's bottomline in the mexican newpaper Reforma, there, he remid us very important things that we don't have to forget, because many times we have a very shortime memory.

A FULL MONTH has passed since the notice we had about Visual FiveWin, and we don´t have any news regarding it, ...... So far, the new Version 9.01 has been released with nothing more than more "buttons with bitmaps".....

I hate to have reason....

lunes, 19 de enero de 2009

Visual FiveWin, Do you really need it ?

Maybe what I'm going to write here today doesn't like to many people, but, that's why I'm here.

I've been following FiveTech's new project: Visual FiveWin, I've downloaded it, tested a little bit, and after reviewing it I think that call it "alpha release" is to be very optimistic (a lot), I would call it "pre-release alpha", it's still many nights, many research hours and many many maaaaany programming lines away to approach to sutff that products already have, such Visual xHarbour for example, for not to mention Xailer, Visual xHarbour is an advanced work in progress but it's still far away of what Xailer has to offer actually, under this circumstances Visual FiveWin has a long way to run.

I' aware that to build an IDE (Integrated Development Enviroment) it's not a piece of cake nor a single programmer work, Xailer's team took over two years to have a working product, Visual xHarbour has taken the same amount of time and it's not ready yet, Visual XBase++, almost 3 years in the oven and we haven't seen so much about it, some screenshots but that's all.

To build an IDE requires a lot of commitment and dedication, not of a lot of programmers but those should be highly skilled ones, I'm sorry if someone feels offended, but many of those FiveWin heads have already gone away.

On the other hand, everybody knows how Antonio works, he starts working hard in a project, gives it all, makes some impresive stuff and after 2 months or less he gets bored and leaves it aside until he feels "the call" again, to mention: FiveWin Pocket PC, after FiveWin Harbour one of the most advanced products, useable, but still with a lot of lacks, FiveLinux, I don't really know how many people is using it and if the final applications are stable enough, what about FiveMac ?, knock knock, is someone out there doing something with FiveMac ?, by the way, does FiveTech has something really useable for Macintosh ?

That's why I suppose that Visual FiveWin is an Open Source project (at least that says in Google Code, remember what happened in 2003 with the attempt to release FiveWin to Open Source) , I understand that without the collaboration of other programmers, Antonio, working alone, has a very hard way to go, please notice, I don't doubt about AL's programming skills, but I hardly believe that working alone, he could deliver a working IDE in a reasonable time.

Now the question is..... Does FiveWin really needs an IDE ? or FiveTech has already noticed that EVERYBODY is going the IDE way (Xailer, MiniGUI, Visual xHarbour, C3 and even the same Xbase++), and they don't want to be left away.

Some time ago the IDE was not necesary, in Antonio's own words, and translated from his comments in the FiveWin's forum:

FiveWin's working model is the same of Clipper's:

* You can use the source code editor you want.
* You can use a BAT or make file, or any make tool available for compiling.
* Even it's based in object oriented programming, you are not forced to work with objects, but you can use xbase commands in a comfortable way.
* The PRG files are available, there's no hidden files which you cannot have access to.
* It's "lineal" programming, not "thousand doors" programming such VB style.

Think for a moment that this basic rules have made of Clipper a standard. CA-Visual Objects, for example tried to change these rules and look where is the product and the IDE today. The same happened to Visual dBase and Borland threw it away.

Translated from FiveWin's forums

But today things are different, it' necesary to go the IDE way and sacrify FiveWin's advantages, as you will read later on, in order to have an IDE.... be careful, what happened to CA-Visual Objects or Visual dBase may happen again.

Two years ago I wrote an article in the Spanish blog about this, the final question wasn't if FiveWin needs and IDE the real question was if the FiveWin programmer was ready to use an IDE, is the FiveWin programmer going to change ?, what's the price to pay for ?

In our Xailer training we have noticed that it's easier to understand how the IDE works for the Clipper or (x)Harbour programmer that have never used FiveWin, same happens to the programmers comming from other visual enviroments such Visual Basic or Visual FoxPro, the FiveWin programmer has more difficult to understand the new programming style since they want to solve the problems the FiveWin's way. Myself, in my first attemps with Xailer used to work with dbf tables "by hand" (USE, APPEND, REPLACE, etc) until I discovered the DataControls, or used to write the source code myself to define a data browser, when Xailer has powerful tools to visually design a browse faster and effortless with the same final result.

Some years ago, the pretext to keep using FiveWin was the supposed "total control" of all the aspects of the application programming, but of course, If you have to write ALL the application, with the single help of a resource editor such PellesC or Workshop, the programmer has all the control (until some "internal" or class fails), but.... in this times, when we have to work faster and deliver results in less time, how pratical is to be wasting such valuable time writing and writing lines and more lines of code when you have tools that do the job for you ?.

Current FiveWin users that would want to use Visual FiveWin should be aware of:

The programming style is QUITE different and the way to organize the application also is, then you have to change the way you think in order to use the IDE and get the most of it.

Your current working applications made with FiveWin will not be able to be used with Visual FiveWin, then you will have two kind of applications: the "hand written" ones and the "visually designed" ones, you can, of course, to share programming routines between both, but these routines will be only "blind process" I mean, those that don't have a display output.

For sure the IDE will not generate command-based code, I mean, you will not find a DEFINE WINDOW ..... instead of that, you will find hundreds of things like; TWindow():New(....), so, object oriented programming will be a NEED. This is an interesting point, in my personal experience with more than 5 years teaching FiveWin I've noticed that more than the 50% of the FiveWin programmers don't have any idea of what OOP is, another great percentage uses it, but they don't really know what they are doing, they only "copy-paste" what they read in the newsgroups, if a oBrw:Refresh() solves the problem, good for it, add such line in the code, what does it ?, where it comes from ?, who cares !, solves the problem. Just a very little percentage has been brave enough to go into the deep of the product to modify current classes and even less FiveWin programmers are able to write their own classes. All the IDEs I know are 100% Object Oriented, if the most of the FiveWin programmers don't know how to work with OOP, how do they pretend to use an IDE ?

What about those programmers with old versions of FiveWin ?, which ones ?, the ones of Harbour or the ones of xHarbour ?

And this is a huge problem from the begining, what compiler are you using ?, Harbour or xHarbour ?, which version ?, because it's clear that every FiveWin programmer has his own (x)Harbour release, In my personal case I have 3 different releases of xHarbour installed on my computer, the one that works with Xailer, the one for console mode applications to be used with XEdit, and the one I use to support my legacy FiveWin applications. So, the IDE is going to work with which compiler version ?. This is not a problem for other IDEs, C3 uses it's own compiler, Xailer uses its own distribution of the Open Source xHarbour, and Visual xHarbour works with the compiler release.

Problem apart are the the FiveWin's libraries, migration from release 2.xx to a 7.xx or 8.xx release may be a real headache, because many classes have change form one version to another or they work in a different way, more functions and controls are added, etc..... to provide compatibility with previous releases will be a real nightmare, to be honest, If I were FiveTech, I would forget about backward compatibility, what for ?, just for testing porpuses ?, what if I make some enhacement supported by an old version that does't work with the newer versions ?, just imagine, if we have 4 releases of FiveWin every year, to support 3 years of previous releases you will need 12 versions of the IDE, not to mention the compiler: Harbour or xHarbour, who is going to keep updated the source code for every single version ?, it's complicated if not impossible.

There's still a lot of work to do to have something useful, but I wonder:

  1. If my current working programs will not work with Visual FiveWin.
  2. If I have to change my programming style and way of programming.
  3. If I have to learn Object Oriented Programming
  4. If Visual FiveWin will not be compatible with my current (x)Harbour version or with my current FiveWin libraries.
  5. If I have to change all those things...

Why not to use a tool designed to be an IDE ? I mean, if you have to rebuild the full application because it will not work with Visual FiveWin, If you have to learn new stuff (OOP), and if there's no a release date of an stable version, why not to start the change today ?, actually you have 2 good options already available: Xailer and Visual xHarbour.

I'm not pesimistic, but I think FiveWin is comming late to the (x)Harbour IDE party, let's wait to see if there's enough party for it, because it can be the last to come and the first to go, but, thus my wise grandma use to say... give it time.

lunes, 12 de enero de 2009

Increase your programming productivity by using two monitors

During the last 10 years, since I could afford one, my personal programming computer has been a portable computer, a notebook or laptop, because of my job as a consultant I'm "on the move" very often.

However not all the time I'm skiping around the world, belive it or not, I spend many hours working in our headquarters, and there I have external wireless keyboard and mouse connected to my laptop:

My choice has always been the ergonomic Microsoft hardware, expensive, very expensive, but worth the price, the quality is great (better than Internet Explorer), if you haven't tried on of these "twisted" keyboards, and you spend more than 10 hours hiting keys, you don't really know what you have been missing, the first two days you feel strange, but after that you cannot live without them.

Back in the age of the CRT monitors, I used to have an external monitor also, for two reasons: first, to give a little rest to the laptop screen, and second because some years ago, the monitors used to have a little more resolution than the laptop screen, that you could use, of course, if the laptop's external monitor adapter supported it.

Many years I worked at 1024 x 768 in the lap's screen and at 1240 x 900 in the external monitor, it used to be very comfortable, the laptop screen and keyboard are used only when I'm away traveling or in Sunday's afternoon when looking for personal stuff in EBay.

The last year we moved to a new office, so I wanted a high-tech facility and specially for myself, I wanted something like this:

No, It's not Bill Gates' office, nor Steve Jobs', nor Tony Stark's (Iron Man), it's not the control center of NASA, it's the HomeOffice (yes ! you read it, it's a HOME OFFICE), and belongs to Stefan Didak.

First time I saw it I told myself.... I want one of those..., but, after reading in Stefan's web why he uses 7 screens, how he has conneted them, and what he uses them for, I noticed that 7 screens were too much for me, so my first attemp was with two monitors only.

But... don't you already have two screens ?, the one of the laptop and the external monitor ?, yes of course, but I wanted A HUGE secreen, if you noticed, in the previous image, the first 3 upper screens share the same wall paper, this means that those 3 screens work as a single one.

WOW !, and how do you do that ?

That's what I wanted to know, so I went to ask to the Google oracle, and I found some video adapters with "DUAL" output, this means that a single card has two output connections for the screens, my problem is that I always use a laptop, so, another solution had to be found, and I found it in a hardware device of MATROX designed to be used with portable computers: the DualHead 2 Go

This little black box, takes the video signal of your laptop, and split it into two external screens and with the laptop screen you are done, you have 3 working screens attached to your computer.

Please notice: the dual monitor works as a single screen, the wall paper covers the two screens and the Windows' menu bar also does it, the screen resolution is the sum of both, so, if every single screen has a resolution of 1240 x 900 the dual monitor is 2480 x 900, more pixels for your money !!!.

The dual screen becomes the main screen, the secondary "extended" screen is now the laptop's screen, you can use it or not, if you need more working space.

To turn off the laptop screen, simply close it and work only with the lap as a CPU.

A great solution for only $ 179.00 USD, the price of the DualHead2Go in its analogic version, it comes with all the stuff needed to be working in 5 minutes after unpack it, after this great first experience I think I'm going to buy the digital version, for only $ 250.00 USD which supports higher resolutions.

Size does matter, so if you want it bigger then you can use a........ not a pill, stop thinking on that.... you can use a TripleHead2Go, which works for desktop or portable computers, this how Flight Simulator 3 looks like in 3 screens using this device:

Then I had to buy new screens, thus my laptop's is a 17 inches wide screen, I bought a couple of ACER X193W 19 inches Widescreen monitors, with a max resolution of 1240 x 900, I bought both in a Mercado Libre (Ebay Mexico) auction for only 240.00 USD BOTH, and because this invention has worked better than I expected, I plan to change them this year for two 24 inches screens.

Two screens over your desk take A LOT of space, so I decided "to rise" them over the desk to make more space and to work in a more comfortable way. I used a two screen VESA compatible support, like this:

The support attaches to the desk without any problem at all, you can modify the high to make them more comfortable, thanks to this, I earned about half a square meter for only $ 90.00 usd.

Ok, so far so good, but until now all have been expenses, where's the so named productivity?

The productivity comes when you start working with them, for example, I want to see how my Windows and Web applications look AT THE SAME TIME, so, I have my huge screen working and looks like this:

Picture of two monitors showing two application screens:

If I make a Print-Screen of the full desktop, then I have a giant desktop that looks like this:

Working with MS Office is a breeze, using Word you can view 2, 3, o 4 sheets in your document at the same time, and as you can see in the next picture, with Excel you can have visible from column A to column AC:

If you Print-Screen, you get this:

Working with Xailer is great, you can view the IDE in a single screen and the form designer in other, or you can see the debugger screen in one monitor and the running program in other, this is quite good and save you a lot of time.

The Print-Screen is this:

Where is the save of time ?, well, you can view and work with 2, 3 or any number of applications you want at the same time:

For example, you can check your email while you are surfing the internet at the same time, if you need to share information between two applications with two monitors is easier, avoiding you thousands of Alt+Tab.

  • Increase the viewing area.
  • The productivity increases at least in a 20% or more, assured.
  • You can perform 2 or more tasks at the same time, by having every application maximized in a single screen.
  • In some cases this could be less expensive than a single monitor with the same viewing area.


  • The use of a dual monitor can takes a lot of space in your desk, but you can solve it using a support, and instead of losing space, you earn more.
  • Two monitors consume more energy (but if Stefan Didak doesn't care about it, I don't do it either).
  • It can be expensive, because you need extra hardware to make the dual monitor to work.
  • It also implies cervical micro movements, that may cause neckache (no simptoms until now).
I'm very happy with my current configuration, a huge dual screen monitor, and if needed, a third one, the next step si to buy bigger monitors 22 or 24 inches.

Now I work faster and more comfortable.

miércoles, 7 de enero de 2009

It's time to get Funcky.... again

In the old Clipper times, one of the most appreciated libraries for Clipper was Funcky.

For sure, Funcky was one of the most complete function libraries with more than 1000 different functios for almost everything. The time has passed and about 5 years ago, Funcky's author, Dirk Lesko, created a new version of Funcky for Windows programming languages.

Release 6.0 of Funcky is the result of 2 years of development, it's not longer a LIB, now is a COM component that you can use via OLE form any programming language: C++, Visual Basic, Delphi, Visual Objects, etc.

(x)Harbour is not a very well known programming language yet (only by us), and if you visit the Funcky's web page, you will see that (x)Harbour is not mentioned in the list of the compatible programming languages, but thinking that there's a Funcky version for Borland C++, is not difficult to imagine that you can use it with xHarbour.

Funcky 6.0 includes a LIB file to be linked to a Borland C++ application, to use it with xHarbour you need to wrap all the functions, but the best and easier way to use Funcky in your xHarbour applications is via OLE.

Funcky works not only for graphical Windows applications, you can use it also for your xHarbour console based applications or with Web based applications.

Funcky has A BUNCH of functions (in fact, they are "methods" of the Funcky object) for A LOT of stuff, some functions are quite useful, some other are just for fun, but it's interesting to look at them. Funcky has several objects in the complete library, to use them is very easy:

oFuncky := TOleAuto():New("Funcky")


oFuncky := CreateObject("Funcky")

And you are done !, all the functions are "encapsulated" into the oFuncky variable, for example, if we want to get a list of all the storage units of your computer (drives, hard disk, memory cards, mapped drives, etc.) we will use the method: AllDrives(), like this :

cDrives := oFuncky:AllDrives()

And this method will return a string with all the letters of the current active storage units ("a: c: d: w:" for example), the Funcky object alone has over 400 methods to do a lot of stuff, the manual is self explained and documents all the features of the library.

But Funcky is only one object, inside the component there's also another 30 specialized objects, with their owns methods, events and datas. There's an object for any programming task you can imagine.

Let's do something more complex, for example to get the trace route to an IP address, to do so, we can use an FunckyTraceRoute object, like this:

oFunckyTrace := TOleAuto():New("FUNCkyTraceRoute")

nTotal = 0
aTrace := {}


DO WHILE oFunckyTrace:Found()

AADD(aTrace,oFunckyTrace:Name+" "+ALLTRIM(STR(oFunckyTrace:RTT))+" ms")



Want a list of all the printers installed in your computer ?, then we use the FunckyFindPrinter object, now in the xHarbour way:

aPrinters := {}

WITH OBJECT oFunckyPrinters := TOleAuto():New("FUNCkyFindPrinter")


DO WHILE :Found()

AADD(aPrinters, :Name())




AChoice (0,0,50,05,aPrinters)

As you may noticed, to use Funcky is very easy, the documentation is very useful, complete and comes with samples for all the methods, it comes in a Windows help file so you can read it any time you need it. There's no an xHarbour specific documentation, but you can use the samples of Visual Basic or Delphi with minor fixes.

One of the main advantages of Funcky is that the values used as parameters to the methods, and the values returned by them are only of 3 data types: Logical, Character or Numeric, so you don't need to struggle with "C" data types such bytes, chars, longs, doubles, etc.

I've written a little sample of how to use Funcky with FiveWin, you can download it clicking here, source code is included and the EXE file also, in case you don't have a way to recompile it, but be aware that you will need to have Funcky installed in your computer.

Funcky is a COM component so you will have to install and register it in all the computers that use your program.

If you don't have Funcky, you can download a "lite" version from, this lite version is not the full featured one, but has A LOT of nice useful functions such e-mail sending and others you can use and distribute for free in all your programs.

The full product is available for 349.00 USD, if you still have you old Funcky for Clipper version, you only pay 149.00 USD, to be honest, worth the price.

lunes, 5 de enero de 2009

New Xailer 2.0 beta 2 now available.

Today the Xailer Team has released what may could be the production version of the brand New Xailer 2.0.

This new beta release is fully functional, and really works quite good, I took a project of an application now in production, compiled with the previous Xailer 1.98 with over 20 .PRG files and it compiled and ran as expected under the 2.0 beta. Compiling and linking process were faster (20.1 seconds to compile and link the entire application) because of the new "multithreating" compilation system included in the new Xailer 2.0 and in xEdit also.

One of the most remarkable features of this beta is its ability to create DLL files with code and resources that work with Xailer made applications, this can be very useful specially if you have your own shared routines, you don't need to include the source code of your common functions nor to link a .LIB file either, please notice that this kind of DLL can only be used by Xailer applications because the runtime is in the EXE.

I personally liked the new HTML exportation feature, now included in the TRichEdit class I will use it in my masive e-emailing program, now I can send messages with plain text and with HTML also, edited with the same mailing application.

Some other things are coming soon, for example the visual report designer which is in a very advanced stage, I suppose it'll be ready for the final release, which will be released sooner than you think, and when I say sooner it'll be really sooner.

The Xailer 2.0 beta is now ready to download, but to try it you must be a current Xailer's 1.98 user and you suscription to the support and updates service must be active also.

More information about this new release and to download this new release, please visit Xailer's blog.

But wait a minute.... today is a holidays in the most of the Spanish speaking countries, today is the Three Wise Men day, in the very latin tradition, this magicians comming form middle east used to bring presents to the good guys, so be attent, the wise men will bring a GREAT SURPRISE to all the Xailer and non Xailer's users very soon, keep in touch.

sábado, 3 de enero de 2009

Raiders of the Lost Services

Several days ago, a good friend of mine, placed a question in a newsgroup about getting access to the Windows Services installed in his computer. His question was simple: He just wanted to know if certain service, installed by himself, were running or not, and in case it wasn't running, he wanted to start it, but using his own source code without the need to run the SERVICES program in the Control Panel.

He found some answers, but no really "THE" answer.

Then I remembered that other friend of mine, Rafa Carmona (a.k.a. TheFull), had posted a very interesting sample in the Xailer's news group about how to access to the Windows Services using the WMI (Windows Management Instrumentation), which is, simplifying, a Windows API to handle different components of the Operating System using OLE.

Reviewing the Xailer's sample, I noticed how easy is to gain access to a bunch of the Operating System features, and even manipulate them, like the services themselves.

Let's see a simple example, you may wish to download a more complex sample later on, keep reading.

To connect to WMI you have to create an OLE object first, and in xHarbour you do it like this:

oWMI := CreateObject ("wbemScripting.SwbemLocator")

This just creates the object, now we have to "connect" to it:

oWMICon := oWMI:ConnectServer()

WMI is a HUGE interface, there are several interesting objects in the system, a full reference and documentatio can be found in the MSDN (Microsoft Developer's Network), I'll save you from wasting time looking into MSDN for the docs, simply click here and you will be redirected to the WMI docs in the MSDN.

The next step is to select the service we want, in our case, we want the "handling services" service, so we get all the services installed in our computer with a simply SQL query, something like this:

oServices := oWMICon:ExecQuery("Select * from Win32_Service")

That easy !, this query will return in oServices an array with "service objects", every object returned has its own methods and data that you can handle to get the results you want.

Let's play with them For example to get a list of the current installed services and their current state, we can do something like this:

For each objService in oServicios

? objService:DisplayName +": "+objService:State


You can also start, stop, resume and pause services using the :StartService(), :StopService(), :ResumeService() or :PauseService() methods, and of course you can create your own services and delete current ones with :CreateService() and :DeleteService(), the complete reference to methos and classes is available clicking here.

Here is a more interesting sample: Let's suppose we want to start the Advantage Database Server service if it's stopped, then we can do something like this:

oWMI := CreateObject ("wbemScripting.SwbemLocator")
oWMICon := oWMI:ConnectServer()

oADSServ := oWMICon:ExecQuery("Select * from Win32_Service where DisplayName = 'Advantage Database Server'")

IF oADSServ:State == "Stopped"



Rafa has written a very interesting sample in Xailer, simply click aquí to get it. If you don't have or don't want to install Xailer to take a look at it, don't worry I have included also the EXE file, the Xailer proyect and of course, the source code in PRG files is included in the ZIP file.

Thanks Rafa for such a great sample !!!!

And Thanks to Mel Smith for helping with the right translation !!!