The CHT Blogger

Thanks for your interest in The Clarion Handy Tools, an awesome collection of productivity enhancements for Clarion developers. These tools consist of an ever-expanding set of Clarion Templates and OOP Classes that extend or complement the normal functionality of the Clarion Application Development System from SoftVelocity.

Monday, February 22, 2010

Small CHT (for C7) Update Posted Today

Discoveries made over the weekend have motivated me to do a small, not-renumbered, update this afternoon.

Earlier in the weekend I posted a problem with ABPROGRM.TPW one of SV's base application templates which due to the use of
#OPEN('PROG02.$$$') instead of #CREATE('PROG02.$$$') causes corruption of generated .CLWs under stress circumstances and particularly on XP machines. The problem caused by this bug is actually worse than I'd imagined - especially on XP machines.

The gist of the above bug is that #OPEN is used to create a fresh temp file instead of #CREATE. Thus, whenever PROG02.$$$ from a previous app is not erased - say by a template error, C7 then generates information from the current app into a temp file file created by a previous application or module. I've seen this numerous times, especially when compiling apps using CLARIONCL.EXE the DOS-prompt utility for generating applications.

I discovered yesterday, when perusing the SV newsgroups that C7 has a bug with the REMOVE command. In C7 (particularly in the context of XP) this command produces an errorcode 5, even though the file was successfully removed. Since the C7 template generator uses the C7 runtime library, I tested #REMOVE, the template version of REMOVE. It has the same problem.

So combining the #REMOVE bug with the #OPEN/#CREATE bug, you can see that the incidence of corrupt .CLW file generation is quite high - in the context of XP in particular.

The remove bug also explains why a utility called HNDABCHKC7.EXE was not correctly fixing the ABUTIL.INC file and changing the prototypes the way that it should have been. C7 users had to run WEBUPDATER C7 to have this change take place because C7 Webupdater is actually compiled in C6. The HNDABCHKC7.EXE utility is compiled in C7 and is executed from the C7 templates such that should you load C7 with any app containing CHT templates, the utility runs and make the ABUTIL.INC change for you without you having to do anything. Our C6 templates have done this for a number of years. The problem was C7 REMOVE is broken.

So, I've reposted our C7 build with a workaround to account for this C7 REMOVE bug, both in the CHT classes and in our templates. Further, I've reposted a new version of HNDABCHKC7.EXE compiled with this workaround.

I've also spent some time reworking HNDCOMPILE.EXE and have re-recorded the accompanying video to provide more concrete examples showing queries.

That new HNDCOMPILE.EXE video is here: HNDCOMPILE VIDEO. This is a 3.5 MB video so give it some time to download.

When you run your Webupdater C7, the changes discussed above will come down to you in the usual manner.

Oh, one other thing. Our HNDABCHKC7.EXE utility, looks for and automatically corrects this #OPEN/#CREATE bug reported above when you open any app that contains a CHT template. Of course the utility only does this if the correction is required. HNDCOMPILE.EXE also checks and makes the correction should it be needed, when you run HNDCOMPILE.EXE as illustrated in the VIDEO. Down the line, when SV makes a permanent correction, I'll remove these double checks.


That's all for now. Have Fun.

Cheers...
Gus Creces
CHT
Visit Website

Thursday, February 18, 2010

New CHT Build 14A1.01 Posted

We've just finished testing and posting CHT Build 14A1.01 in both C6.x and C7.x versions.

This version removes all dependency on HND*.LIB files with the exception of HNDSPELL.LIB and HNDML.LIB. These two remaining .LIBs are based on CHT DLLs which are exclusive to CHT. All other HND*.LIBs which may have potentially included WINAPI functions located in MS Windows DLLs, used by Clarion or other 3rd parties, will be removed from your CHT installation by our installer because they are no longer necessary. The WINAPI functions in various CHT classes that once depended on these .LIBs are now accessed by dynamically loading the Windows DLL in which the function(s) are located.

This avoids entirely the possiblity of a "Duplicate Function Declaration" error (or similar) produced by the Clarion compiler.

You do not need to change anything in your CHT based apps to incorporate this change.

Other changes in Build 14A1.01...
New Demo APP called: HNDZIPBACKUPTOGMAIL.APP an app that lets you zip some files and send them to your gmail account as a backup mechanism.

Significantly Changed Demo APP: HNDGMAILEXPLORER.APP this app now lets you enter your own GMAIL account and visit your gmail account with a single click. There's also a backup to GMAIL capability in this application.

The HNDERROR class which is derived by all CHT classes - and are hence available for error trapping and logging - now has a direct capability to write to the windows error log. You'll remember that in previous CHT versions, you needed to add the HandyCOMEventLogger template to your procedure. While this template and its accompanying DLL-based functionality is still available, you no longer need this in order to log errors to the Windows Error Log. The functions involved are described in HNDERROR.INC and look as follows:
!Windows event log direct from this error class.
PostWindowsEventLog PROCEDURE (STRING xDescription, LONG xType=HND_INFORMATION_MESSAGE, LONG xCategory=0),BYTE,PROC,VIRTUAL

GetLastEventLogged PROCEDURE (),STRING,VIRTUAL

LogErrorEvent PROCEDURE ( STRING xsMessage ),BYTE,PROC,VIRTUAL

LogInfoEvent PROCEDURE ( STRING xsMessage ),BYTE,PROC,VIRTUAL

LogWarningEvent PROCEDURE ( STRING xsMessage ),BYTE,PROC,VIRTUAL

Cheers...

Gus Creces
The Clarion Handy Tools Page
www.cwhandy.com
gcreces@gmail.com
February 18, 2010

Thursday, December 31, 2009

Happy New Year to CHT Subscribers in 25 Countries!


We've just finished posting Build 14A.00 in time for the new year!



And 2010 is CHT's 14th year. We're kind of glad to have year 13 behind us. ;-)

Looking back at the document CHT Templates New/Revised In 2009 I see that some 60+ templates were either added or revised in 2009. Considering that most of these templates also use
at least one underlying CHT class, that means also that there are a lot of new and revised classes added during the course of 2009. Combine that with having to test everything twice - once for C6.3 and once for C7.0 and then again
for C7.1 - and your CHT tool guy has been a busy boy. ;-)

All in all C7.1 looks pretty good. There are a few quirks that need to be ironed out but the product is nearing stability and reliability. I don't expect to freeze C6.3 forward development in 2010, since I think many of you are not ready to migrate completely to Clarion7 yet. But that's something I'd like to get feedback on during the course of the upcoming year.

Over the next couple of weeks I'll be posting information on our January What's New Page about this build. I've completed some of the SUGGESTIONS posted here during 2009and will continue to work forward on any that I didn't complete. And, of course, feel free to make SUGGESTIONS for new features or requirements as you think of them.

Come to think of it, Johan De Klerk, I've added a couple of new functions to HNDUTIL which we discussed last week having to do with uniquely identifying the hardware on which your software is running. These functions are:


HNDUtil.GetWindowsSerialNumber PROCEDURE ()
HNDUtil.GetHardwareDriveDeviceID PROCEDURE (LONG xDrv=0)
HNDUtil.GetHardwareDriveSerial PROCEDURE (LONG xDrv=0)


You'll remember I added a .NET based implementation (for Win32) last build for getting the hardware serial number from a drive. Johan has customers whose machines are not, in many cases, ever going to be .NET compliant, so he asked me for a straight Win32 implementation of this functionality. Johan, this should give you what you need. On older machines you may have better luck with GetHardwareDriveDeviceID than with GetHardwareDriveSerial. Both functions will give you something unique tied to hardware that cannot be copied from one machine to the other by cloning the contents of a hard disk. GetWindowsSerialNumber will give you something unique as long as the two machines don't boot from the same copy of MSWindows.

As a temporary measure, mostly for my own benefit, I've created a small DOS prompt app for C7 that generates a batch file for bulk compiling C7.1 solutions. As long as the .SLN and .CWPROJ files for an app exist and the .CLWs have been generated earlier. You can batch compile your apps using a .BAT file generated by HNDCOMPILE.EXE located in c7/accessory/hnd.

Here's how to use this:
1) Shell to the DOS prompt
2) Change directory to where your apps are located and from there type as follows: use your own c7 path).
3) c:/c7/accessory/hnd/HNDCMP.EXE HNDNET*.SLN if you only want to batch compile apps matching that wild card.
4) You can have the created EXEs compressed by adding a 1 after this as follows:
c:/c7/accessory/hnd/HNDCMP.EXE HNDNET*.SLN 1

As I mentioned in an earlier post C7.1 broke the command line app generate function /ag which worked in C7.0 so for this to work your apps are going to have to be already fully generated. This also assumes your machine has MSBUILD.EXE on it, which it will given that this is what's used by C7.x to build your solutions. The trick may be that your DOS path does not point to the directory where MSBUILD.EXE is located. I'll leave it to you to work that out for yourself by modifying the DOS path statement.

I'm working forward on HNDCMPC7.APP which will work pretty much like C6 HNDCMP.APP minus some of the C6-specific features and including some C7-specific features for batch compile. I was able to test-compile all 104 C7 demos with the temporary HNDCOMPILE.EXE method described above.

That's all for now. Keep a lookout on the January 2010 What's New page for ongoing elaborations of CHT features added in 2009.

Any questions, or suggestions, feel free to post them here.

Best of the NEW YEAR to all of you!

Cheers...
Gus M. Creces
The Clarion Handy Tools Page

Tuesday, August 25, 2009

Small Upated Posted to Build 13C1.00

We've just posted a small update now available via Webupdater (C6) and Webupdater (C7).

FIRST...

The new Tape calculator now has a new function:

PassCalcTapeText PROCEDURE (STRING xTapeText),VIRTUAL

You can embed into this function inside your app to pick up the string that contains the current display tape value. This function is called anytime the EQUAL key on the calculator is pressed. This function works equally well with a threaded or unthreaded calculator.

SECOND...
There was a problem with the calculator maintaining focus when implemented as a Threaded calculator any time the EQUAL key was pressed. This has now been solved so that you can use the calculator entirely from the keyboard (without the mouse) and even after the EQUAL key is pressed, focus on the calculator is maintained.

THIRD...
Both Calculator templates (HandyCalcTapeEntryControl_ECF, HandyCalcEntryControl_ECF) now pass the picture that you place on the template-provided entry control to the calendar. Rather than using ROUND() internally, the HNDCALCCONTROL class now performs a FORMAT() of the calculator register data when you click the RD key.

FOURTH...
I revised the HNDDISK function called DRIVESPACE.

HNDDisk.DriveSpace PROCEDURE (STRING xRootPath, *STRING xFreeBytes, *STRING xTotalBytes)

This should now return the xTotalBytes value correctly for Terrabyte sized drives. The function was and always has worked correctly for drives smaller than one Terrabyte. The data width has now been increased from 40 bits to 64 bits so that we can pick up the size of these drives correctly. One caviat with this function. With terrabyte drives, the function will return smaller sizes if the user asking for drives sizes has been assigned a disk quota. A disk quota determines how much data any user is allowed to place on the drive, so it stands to reason that this is seen as the largest disk size available to the user, hence that is the disk size. Without a disk quota, the true size of the drive is available even with the over 1 terrabyte drives.

FIFTH...
Someone asked last week if the HNDLRNSV.APP was available for C7. It wasn't at that time but we've included it in this update.

SIXTH...
The HNDZIPNEMAIL.APP provided with with C6 and C7 is now the same as the one I posted on the SV forum this past weekend. This later version (V 7.5) allows for multiple configurations that can be recalled with the click of a button.

SEVENTH...
HNDDATES has been changed to reflect a higher Maximum Clarion date value which was introduced a couple of years back, with C6 I believe it was. The enforced Clarion Standard Date range is now January 1, 1801 through December 31, 9999.

That's all for now. You can pick up these changes any time with your WEBUPDATERs.

Cheers...
Gus Creces
The Clarion Handy Tools Page
Visit Website

Friday, August 21, 2009

Automatically Compress Your EXE's When Compiling

A global template we haven't yet told you about called, HandyExecutableCompressor can be attached to your application as a child of our master global template AACHTControlPanel.

When enabled, this template generates and executes (after compile has completed) a batch file which invokes a shareware executable compressor now included with CHT. Your executable file (.EXE) is compressed by 2/3 without affecting it's performance.

This has some obvious benefits, especially for security in making your .EXEs more secure against hackers looking for embedded strings such as passwords. If you're providing direct-downloadable executables it saves you having to first ZIP the exe while still reducing web-transport overhead by 2/3.

Click this link to view a short video that illustrates the compressor in action:
HandyExecutableCompressor Video

Cheers...

Gus Creces
The Clarion Handy Tools Page
www.cwhandy.com
support@cwhandy.com
August 21, 2009

Wednesday, August 19, 2009

Webupdater (C7) Change Posted

We've just posted a change to the C7 Webupdater to provide a set of menus under HELP along the lines agreed upon by 3rd party developers. We've used the naming convention suggested by Lee White which I gather is now the default for how these menus should integrate into the C7 IDE.
That is Help -> Accessory -> Clarion Handy Tools -> Various menus and sub-menus.


chtc7help.gif



At the same time, we're having the installer remove all but one of our support applications from the Tools menu, leaving only the CHT backup tool under the IDE's TOOLS menu. All others have been moved under HELP as they were primarily help related.

We've also added a new submenu to the CHT section of help called "CHT Videos Direct". This is a section of short instructional videos (.SWF) that you can run as needed directly from the C7 interface. Specific videos will not stay here indefinitely as we plan to use this area to introduce new features, or to draw attention to under-utilized features in an effort to make you familiar with their use. Videos retired from here will make their way to one or the other of our video player apps, or perhaps both.

Since we don't use any other 3rd party tools at CHT, we're not able to see how this "Accessory" menu integrates with what other 3rd parties have done or may be doing. We have endeavored to follow the conventions agreed upon for integration with C7. Feel free to post suggestions (perhaps with screen snaps) if you have something constructive to add to this. Changing the menu layouts is no big deal if necessary for better overall integration.

Cheers...

Gus Creces
The Clarion Handy Tools Page
www.cwhandy.com
support@cwhandy.com
August 18, 2009

Tuesday, August 18, 2009

CHT Build 13C1.00 For Clarion 7 Now Available

We've just posted the Clarion 7 version of our new 13C1.00 Build. This includes the full feature set already released to Clarion 6 last week. We're now also shipping with Clarion 7, approximately 100 of the 130 demo applications available to Clarion 6, more are being converted and tested each week. Our intention is to have the full suite of demo apps available to C7 as soon as practical.

Cheers...

Gus Creces
The Clarion Handy Tools Page
www.cwhandy.com
support@cwhandy.com