The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: xPL C++ Lib released




Hi Mal,

> For anyone interested in developing xPL applications in C++ instead
> of Visual Basic, I've released a set of classes that hopefully will
> make life a little easier.
>
> The code forms the basis of all the xPL stuff I'm working on, and
> provides the core messaging and configuration functionality, as well
> as hiding all the windows service gubbins.

This looks great - I intend to use it to re-write my joystick app (which
allows you to use your game port as an I/O device, and transmits xPL
messages indicating the status of the input pins) using your new classes.

A couple of points:

In baseService.cpp:
When parsing the command-line options, you do a case-insensitive comparison
for "/install", but a case-sensitive comparison for
"/Uninstall" - probably better to make both of these options
case-insensitive.

The usage information you display seems to be wrong - it talks about using
-i and -d for install/uninstall operations.

Also, when installing the service, you use the value of argv[0] to
determine the path to the exe file.
This doesn't always work (as I found out) - consider the following:

If you run something like:

c:\xpl\xpljoystick\release\xpljoystick.exe /Install

Then it works fine. However, if you do:

c:
cd\xpl\xpljoystick\release
xpljoystick.exe /Install

Then it doesn't, as argv[0] just contains the "xpljoystick" bit
(i.e. without the full path).
Not exactly a major problem, but something to be aware of never the less.
I guess you could detect whether argv[0] was an absolute path (by checking
for the presence of a backslash or something) and if not, use
GetCurrentDirectory to prepend the current directory in front of argv[0] to
give you a full path.

Anyway, great work so far - it's nice to be able to produce some apps that
don't depend on the .NET framework or any ActiveX objects.

Regards,

John




xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.