|
Just starting out with Power++ and need a pointer (pun intended) or two in the right direction? Or do you need help in a specific aspect of Power++? Or, just maybe, you consider yourself a whiz, and want to learn something totally cool that you didn't know. Here you will find code snippets, example programs, patches, updates, and add ons so that you can become the best and most knowledgable Power++ developer around.
Patches, Updates & Add Ons
- DataWindow
Patch P++ 1.5, 2.0
There are now patches available which fix many of the bugs in the DataWindow control - one patch is for Optima++ 1.5, and one is for Power++ 2.0. To get a list of problems that the patches fix, go to the Power++ Patches page. Alternatively you can download the desired file directly. For Optima++ 1.5:- Readme file: ftp://ftp.powersoft.com/pub/optima/maintfls/v1.5/dwreadme.txt
- Patch file: ftp://ftp.powersoft.com/pub/optima/maintfls/v1.5/dwPatch.zip (928 KB)
- Readme file: ftp://ftp.powersoft.com/pub/powerpp/maintfls/v2.0/dwreadme.txt
- Patch file: ftp://ftp.powersoft.com/pub/powerpp/maintfls/v2.0/SETUPEX.EXE (2.2 MB)
- DBCS
Fix #1 (1.2 MB) P++ 2.0
This is a Power++ fix for DBCS (double-byte character system, such as Chinese or Japanese) Windows 95 from Power++ Support Dept. This fix makes Power++ much more stable than it was on DBCS versions of Win95. The problems come from an IE3 installation overwriting some DLLs of Power++. This is compatible with all editions Power++ 2.0 (build 380). Simply extract all files in the zip onto Power20 system subdirectory. This should be installed by anyone who is using the Chinese version of Windows 95.
Submitted by Chan Kuo Chun - DBCS
Fix #2 (290 KB) P++ 2.0
This is another patch (see above for the other one) of Power++ for DBCS (Double-byte Character System, such as Chinese Windows 95) systems. This fix solves the serious problem that the bottom parts of the Wizard dialogs were cut-off on these systems. To apply the patch:- Unzip the patch file into your Power20\system directory.
- CD to the Power20\system directory.
- Each .zip file contains a .bat file with a name like apply???.bat. Run the batch file.
Submitted by Chan Kuo Chun - DrainPipe
Viewer 1.0 (253kB)
A little utility program that you can use to view the output that would normally go to the Power++ debug log when running your debug application outside of the Power++ environment. Includes stand-alone executable and source - no runtime DLL is required. - Help
Workshop
This is the newest version of the Microsoft Help Workshop. You use it to make Windows help files. A version of the workshop comes along with Power++, but this is the latest update, which includes, among other things, support for RTF files created in Word 97!
Submitted by Herbert Menke - NetManage
ActiveX Control Expiration Patch (20KB) P++ 1.5
If you're using Power++ 1.5 then you have NetManage intranet controls (POP, HTTP, SMTP, etc.) which seem to be marked as betas. These controls expired on June 1st, 1997 and NetManage has released this patch to correct this problem. You should apply the patch only if you receive the following error message when running you application: "This version of the NetManage Internet Controls has expired."
Submitted by Rahim Pira - Power++ 1.0.01 Developer Patch
Home Page: http://www.sybase.com/products/powerpp/patches.html
Download: ftp://ftp.powersoft.com/pub/optima/maintfls/v1.0/patch01.zip - Power++ 1.5 Patch
The following issues are addressed in this patch:- Bug fix: the code editors under Hebrew and Arabic Windows 95 did not work properly.
- Bug fix: remote debugging (including remote debugging of Win32s applications) did not work properly.
- Bug fix: Close did not work on an asynchronous WSocket after a SocketCloseEvent occurred.
- Bug fix: requesting 'no warnings' in the target options did not remove all warnings.
- Enhancement: the error log is opened up to the first target containing the an error, avoiding targets which have only warnings.
- Enhancement: better support for databases which do not support absolute cursor positioning in ODBC (such as Microsoft SQL Server 6.5).
- Bug fix: the query Open method was not properly closing the cursor if it was already open.
- Platform
(Win32) SDK January '98 (Download Page)
Click on the link above to go to the download page of the Microsoft Platform SDK (formerly known as the Win32 SDK). This is wonderful for all of you who have the Developer version of Power++, which does not ship with the SDK. Using the SDK allows you to make calls directly to Windows API functions. Note that the header files included with this SDK will not compile as-is, and require some modification. Download file w32sdk.zip (but also see below, under update), which was put together by Seairth Jacobs and contains modified versions of some files in the SDK which allows them to compile properly with Power++. (These are based on Michael Lindell's changes to the same files for a previous version of the SDK). All the changes can be found in #if defined(__WATCOMC__) / #else / #endif blocks, and it's recommended that you take a look at these to see exactly what's being done since there is always a possibility that something isn't being redefined properly for Power++.
Update: The patch provided was made for the November '97 release of the SDK... The SDK available now is the January '98 release. I haven't tested the patch with this release, so I don't know if it is still valid... - Power++
2.5 Component Library update (7.6 MB) P++ 2.5
These are the most current runtime libraries for Power++ 2.5. Among other things they fix the ActiveX container memory leak.
Submitted by Wylie, Neville" - Watcom 11.0 and Power++ 2.0 runtime libraries version C (As included with Watcom C++ 11.0c)
Those libraries have a lot of bugfixes, just copy them at the correct locations on your harddisk and rebuild your projects.
The download is split into the static and runtime versions of the libraries.
Look here for a (not complete) list of bugs and changes
Submited by Stephen Howe
Sample Programs, Libraries, Classes, Templates...
- akInternet
Classes (130 KB) P++ 2.1 And Up
Native Power++ classes for HTTP, POP3, and SMTP. No run time licenses. No entries in the System Registry. Contains the DLL and LIB files for all three classes and a sample project to demonstrate their use. Source code is available for a small fee. See the included Readme file for more information.
Written by Al Kaiser - Arranger
Sample Program (8 KB) P++ 2.0 And Up
Updated Arranger (50 KB)
This is a little tool (with source code) that positions the Power++ editor windows. It moves the editor windows to the left side of the screen, but it can be modified to move them anywhere you like. It looks up all windows with 'all code' or '.cpp' or '.hpp' in the title bar. The Updated Arranger program was created by Andres Galeano, based on the first version. Some customization options were added that are saved in the registry. Also, you can now arrange the other Power++ windows like the classes, targets, file, resources view, etc. and the debugging windows (locals, watches, call stack, etc.) Also the windows are now cascaded and placed in such a way that it is easy to view your code and the debugging windows, and at the same time the power++ view are out of the way. Finally all the windows are cascaded in such a way that you can always see at least a corner of any of your Power++ open windows. (The original version is still available for download above in case you don't like the way the new version arranges your windows.)
Written by Markus - WAXString
Class (4 KB) P++ 2.0 And Up
The WBString class we shipped with Power++ is really just a simple wrapper on the BSTR type and doesn't have all those sexy WString features that can save you lots of time. This is a new class, WAXString, which you can use in place of a WBString if you so desire. WAXString actually inherits from WString so you can use it wherever a WString is needed. See the included readme.txt file for more information.
Written by Eric Giguere - Backup
Planner (345 KB)
This is a nice little program which makes use of the GNU zip.exe program to back up your Power++ projects to pkzip-compatible archive files. A default backup plan is setup to backup all your Power++ projects (excluding their Debug and Release folders) which are located in the default Power++ projects folder. You can setup your own plan to customize what is backed up, and to where. Updated: the source code included in an encrypted ZIP file is now available for all! The password is "RelativitY".
Written by Al Kaiser - BigRichTextBox
Advanced Class (2KB) P++ 1.5
In Power++ 1.5, there is an artificial limit to the amount of text you can type into a rich text box (though not to the amount you can load into it). Also, using the GetText() method will only return up to a certain limit of characters. Finally, the SetMargins() method doesn't seem to work. To get around these limits, this Advanced Class Definition was written.
Written by Bill Auerbach - Browse
Folders (20KB) P++ 1.5 And Up
This is a Browse Folders dialog which presents a treeview showing folders which can be expanded and collapsed (much like the standard Win95 dialog), and a drive combobox with icons and volume labels. A mechanism is provided to pass a WTextBox that will be updated with the user clicks OK (or you can use a public GetSelectedFolder method). It does not require the Win32 SDK. This example implements the dialog as a DLL, but you can also build it directly into your project if you prefer - for more information read the 'readme.txt' file included.
Written by Bill Auerbach - Browse for
Folder Function (1KB) P++ 1.5 And Up
This is a function which simplifies the use of the SHBrowseForFolder() Win32 function (and therefore requires you to have the Win32 API headers). Using this function, a standard Browse for Folder dialog box displays to allow the user to select a particular folder. This has been tested with Windows 95, Windows NT 3.51 and Windows NT 4.0.
Written by Ivan Bowman. - CanvasExtension
Classes (37 KB) P++ 2.0 And Up
This is a serious and well-implemented extension of the WInfoCanvas class provided by Power++. The reasons for using this class over the one provided with Power++ is that the Power++ version has:- Poor support for device capabilities,
- No support for changing the window/viewport extents and origin,
- Only support for creating a font with a correct pointsize in the WCMMText( MM_TEXT ) mapping mode,
- To have an easier support for isotopic mappings where positive y is down
- To be able to draw a coloured bitmap to a printer canvas by converting a DDB into a DIB.
Written by Herbert Menke - WCenterMessageBox
(9 KB)
WCenterDialog implements a 'One Shot' CBT hook, that can be used to center or position the next window, which is activated. It can be used with a messagebox, a common dialog or any other window.
Written by Herbert Menke - CRecio
Library (239 KB) P++ 2.1 And Up
CRecio is a gnu text file library wrapped with a p++ class. It's a great utility for reading/writing ASCII text delimited and column delimited files. It was written by William Pierpoint and if you find this useful, you should send him a thank you. The class is not quite finished, so feel free to add to it and share the results.
Written by Al Kaiser - Component
Converter (14 KB) P++ 2.0 And Up
Debugging of native components is very tricky and the IDE is very unstable in the component development. Very often it is necessary to make a complete remake of the component. The idea for this program is to convert the wxc file of the component to a normal class file, that can be used for an advanced class definition, doing here the main development and debugging, and convert it back and design the design-time property sheets. ComponentConvert cannot convert a class to a component file, that was not created in a component project: The first source file must be always created in a component project, then it can converted and back The converting from a component to an advanced class and vice versa can be repeated.
Written by Herbert Menke - Contact
Screen Saver (1.5MB) P++ 2.0 And Up
This is the source code for a screen saver written in Power++ based on the movie Contact. It demonstrates supporting a preview window, passwords, and options. Most of the screen-saver-specific parts of the program are handled in the ApplicationClass. For information on using the screen saver, see the ReadMe.txt file. This updated version of the screen saver implements screen saver options (such as picture delay time and control over the audio and video). If you wish to download the compiled version of the screen-saver, you can do so from the Contact web site.
Written by Brendan Mirotchnick - Control
Panel Example (14KB) P++ 1.5
This sample project shows you how to make a control panel applet with Power++. The important parts of the project are in applic.wxc, so look there to see how it is done. Note that there are some problems using this project in Power++ 2.0, but you will be able to get the idea of how to do it in 2.0 just by looking at this one. This project requires the Win32 SDK to compile.
Written by John Davis - Control
Panel Template (9 KB) P++ 2.0 And Up
This is a target for creating control panels. When you now make a new target, you will have a new icon available for creating CPL targets. This target template has been written by Andre Schild. The original code for the CPL.CPP has been posted by John Davis (see Control Panel Example above). You may freely use the template for anything you desire. If you make enhancements to the template please send a copy to the author, so others can profit of your work.
Written by Andre Schild - Coolbar
(1KB) P++ 1.0 And Up
This is a text file with instructions which were posted to the OptimaPP mailing list explaining how to make toolbars in your Power++ programs look like those from Internet Explorer 3 (and all new Microsoft products). It is also shown how one can get rid of the annoying line above toolbars.
Written by Michael A. Browning. - CPU ID Class
(4KB) P++ 1.5 And Up
This is a class which uses some assembly code to get various pieces of information about the user's processor such as the vendor string, model, stepping, family, FPU availability and MMX availability. The readme included contains sample code to use with the class.
Written by Michael Buchholz. - Cube Game
(41KB) P++ 1.5 And Up
This is a game written in Power++ (ported over from Delphi by the author) which was originally published in a German magazine called DOS. The purpose of the game is to pick up colours by rolling a cube over a coloured plane, which is very good training for 3-dimensional thinking. More interesting, the program shows how to draw on canvases, handle form resizing, use a colour dialog, menus and a timer. It allows mouse and keyboard for playing, has (rudimentary) help, and it uses a thread to find a solution for the game.
Written by Leopold Toetsch. - Custom
Datasource Example (14KB) P++ 1.5 And Up
This is a simple demonstration of how to write your own datasource. It should illustrate enough of the principles to get you started. The most important thing is not to try and implement your datasource as an Power++ managed class - it must be declared WDLLEXPORT. See the readme included for more information.
Written by Dave Foulkes - Custom
Draw Example (104 KB) P++ 2.0 And Up
This sample demonstrates, how to implement the powerful custom draw method of the common controls. You can set a different textcolor, backcolor and a font for every subitem of a listview. The ownerdraw style is not needed to draw a picture in a subitem. A brush can be used to draw the background of a subitem. Also, the common controls support the new Paint message, to realize a flicker free updating. This implementation creates a bitmap to draw to for every paint event, which it is taking up a lot of CPU time, but uses no additional resources. Requires the Win32 SDK.
Written by Herbert Menke - DataWindow
Array Sample (20 KB) P++ 2.1 And Up
This is a sample which demonstrates how to use arrays as arguments to DataWindows. The trick is to pass a WVariant argument to the Retrieve method of the DW. This argument must be created from WSafeArray. Each element of this array is of type WVariant. Big thanks for this one to Jan Zajac who provided the clues.
Written by Dave Appleton - Date Class
- public domain (61KB) P++ 1.0 And Up
This is the public domain Date class modified to work with Power++ and supporting a DMY format. Note: to compile with Power++ you must define the macros ___OPTIMA and BOOLEAN_EXISTS in the Targets - Default Options - CPP,WXC,WXF or Precompiled Header - Macros property sheet.
Modified by Robert Leftwich. - CDate
Class (10KB) P++ 2.1 And Up
This is a date class for translating from Sybase SQL Anywhere to European or Brazilian format, without changing the settings in SQL. It translates to long and WDate too, returns the day of the week, get days after and before from another date, and you can sum x days in the date to get the new date. This ZIP contains a Power++ project, with the CDate class and a form for testing purposes.
Written by Paulo Assis. - Dial-Up
Sample (18KB) P++ 1.5 And Up
This is a full Dial-Up Networking client written in Power++. It allows you to connect, disconnect, get networking information, and manage your phone book. All this is accomplished using calls to the Win32 API, and more specifically, to ras.h. That being the case, access to the Win32 SDK is required to compile this program.
Written by Dan Zeevi. - DialogEx
Class (10 KB) P++ 2.0 And Up
The WDialogEx class is an extended WDialog class, derived from WDialog and WModelessDialog. The purpose of this class is to use the same form as both a modal and a modeless dialog box depending on what you happen to require at a particular point in your program. The default mode modal. The mode of the dialog can be changed with a line like myform->SetModal( false ). Included is a sample program which demonstrates using the class. To make one of your forms use the WDialogEx class, you have to use the Object Inspector to set up WDialogEx as the Advanced Class.
Written by Herbert Menke - Directory
Browser (8KB) P++ 1.5 And Up
This sample program is an example of how to browse for folders without using the Win32 SDK. It needs a bit of work to be used in an application, but shows the basics, and would be a good starting point for anyone who needs to implement a 'Browse for Folder' dialog but doesn't have access to the Win32 SDK (or simply does not like the standard Windows dialog).
Written by Joby Allen - GetDisplayPathName converts a short path into it's long names (1KB) P++ 2.x
Convert 8.3 filenames/paths into the long names.
Code by Michael Doppelbauer . - Drag
and Drop sample (42KB) P++ 2.5 And Up
The Drag&Drop sample shows how to set a NOT-cursor in an drag & drop operation of treeviews (like windows-explorer), how to set a different dragging image, how to create a listview with more than 16 colors (tip from Herbert Menke) and how to set different cursors instead of the default-windows cursor. In the selection-event it there is a comment how to create a multi-selection treeview.
Written by Markus Doppelbauer. - Drive
Combo Box (9KB) P++ 1.5 And Up
This is a sample program which effectively implements a drop-down combo box with a list of drives available on the user's computer. The combo box is owner-drawn, and a small drive icon (showing the correct type) is displayed beside each drive listed. Note that the program requires the Win32 API headers to be compiled.
Written by Jonathan Danylko. - Embedded
SQL samples (57kB) P++ 2.0 And Up
This file contains the embedded SQL examples from the March issue of the C/C++ Users Journal(tm). They have been modified to get them working under P++.
Written by Steven Yetters. - Enter-Tab
Example Code (1KB) P++ 1.0 And Up
This is a function which returns the next control in the tab order (after the one that currently has focus). Along with it is the code which would go in the OK event of the form if you wanted the focus to be shifted to the next control every time the user pressed ENTER (in the same way you can use the TAB key). Declarations for the Win32 SDK functions needed have been included, so this code does not require the Win32 API headers.
Written by Ivan Bowman. - EnumerateTopLevelWindows
Example (8 KB) P++ 2.0 And Up
This is a little sample program which demonstrates how to use the EnumerateTopLevelWindows function. The program displays a list of currently visible windows, and allows you to hide or re-show any selected window from the list. You can also refresh the list with the click of a button.
Written by Glenn Pope - Extended
Explorer (65KB) P++ 1.5 And Up
This is a clone of Windows Explorer written in Power++. It is a work-in-progress, so a lot of the functionality and features are not yet in place, but the foundation is there. The author encourages you to check it out and send in any enhancements you have made to it - he will add them to the program. Note that you need the Win32 SDK to compile this program.
Written by Todd Porter - Faure
Program Source (130KB) P++ 2.0 And Up
Faure is a tool for creating automatic lexical analyzers and parsers accepting SLR grammars. The Faure program itself requires Win 95/NT to run, but the tables it generates can be used on any Intel based system. (Or, indeed, any system so long as you make suitable arrangements to read the file from a disk.) This updated version includes the three libraries that are required to compile the program. Please read the ReadMe.txt file before you try to compile.
Written by Narti Kitiyakara - File
Services Class (15 KB) P++ 2.0 And Up
This is a class implemented as a LIB which exposes many basic file system services as an interface (all methods are static). Along with creating shell links (windows shortcuts), this class also has the methods: AddFolder, CopyFile DeleteFile, DeleteFolder, GetFullPathName, GetShortPathName, and GetWorkingFolder. If you wish to compile the LIB yourself, you need the Win32 SDK, but the compiled LIB is included in the Release folder of the ZIP file so you do not need the SDK to use it.
Written by Nat Vinod - FileBitmap
Class (10 KB) P++ 1.5 And Up
This is a WFileBitmap class which comes along with a sample project written and tested in Power++ 1.5. The class should be used as a proxy for the WBitmap class, and was not designed as an extension of the WBitmap class. It handles a "memory-proof" bitmap creation from a .bmp file, in place of the WBitmap regular method that does not free the memory associated with the bitmap. Please see the included readme file for more information.
Written by Christophe Douy - FrameParent
Sample (9 KB) P++ 2.0 And Up
This is a neat little sample program which demonstrates using the frame component supplied with Power++ in a way similar to the Panel control of Delphi or VisualBasic. In effect, the controls you desire are made children of the frame, and as such, when the frame is moved, the children are moved, and when the frame is hidden the children are hidden with it. Another neat little feature is that you can drag the frame around (at run time!) with the mouse pointer, and move it on your form... the children move along with it.
Written by Dave - GeoPoint
ActiveX Sample (1.7MB)
A sample demonstrating the GeoPoint ActiveX control from Visual Components. You must use the shipping version of Power++ 1.5 and obtain the trial version of the GeoPoint control from http://www.visualcomp.com/products/gp.htm to use this sample. - GrowableArray
Template (1KB)
This is a template subclass of the WArray template. It provides all the same functionality, with the addition of a handy feature which lets it dynamically grow in size as needed.
Written by Eric Giguere / Packaged by Dave. - HashTable
Example (9 KB) P++ 2.0 And Up
One of the more powerful Classes/Templates found in the Watcom C++ Library that comes along with Power++, is the Watcom HashTable Container. Trying to decipher the supplied Watcom C++ help files to a concrete example is one of the most difficult tasks a new programmer would be faced with. The example provided here shows a working example that will, hopefully, allow someone to take advantage of this tool. The example is setup to provide timing for building the table and for searching the table. Also see Value Vector Example.
Written by Glenn Pope - HelpMode
Example Program (12KB) P++ 1.0 And Up
This is an example program which makes use of the HelpSelectCursor function (available below), and chained event handlers to simulate the functionality of the '?' button in the top right corner of dialog boxes which support context help. This can be used to invoke the HelpMode of your program's main form by clicking a help button on a toolbar.
Written by Bill Klein. - HelpSelectCursor
Function (1KB) P++ 1.0 And Up
This is a function which returns a WCursor of the systems's Help Select pointer, which was left out of the Power++ 1.5 stock cursors. Code is provided so that you need not include the Windows API header files in order to use this function.
Written by Ivan Bowman. - Ident
Daemon (200KB)
This is a little Ident daemon for Windows. Documentation is at the top of the code for the main form.
By Steffen Uhlig - WInPlaceTextBox
Class (44 KB) P++ 2.0 And Up
The class WInPlaceTextBox allows editing all subitems of a listview in the report view. Also editing the items of a listbox is provided. It requires Power++ 2.0 and the Win32 SDK
Written by Herbert Menke - ISAPI
enhancements(7 KB) P++ 2.5
Two enhanced C++ files to allow ISAPI extensions written in Power++ to get notified about unload requests from the webserver. Tested with IIS 3.0, WebsitePro 2.14. Have a look at the included readme file.
Written by André Schild - Instance
Library (4 KB) P++ 2.0
This library lets you check for a current instance of the application based on the passed WForm's title. When your program is run, if another instance is running, it will be selected and the second instance will be terminated. If the first instance is minimized, it will be restored. Another instance is determined by matching Windows' titles. If the other instance either starts or ends with the same name as the second instance, the match is successful. Please see the included file instance.hpp for more information. In this updated version, you can now extract the command line that was used to launch the new instance of the application. In this way you can load a particular document in the current instance of your application, when the user double-clicks on that document in explorer...
Written by Bill Auerbach - WJpeg
Class (293 KB) P++ 2.0 And Up
The WJpeg class provides elementary functionality into the JPEG routines written by The Independent JPEG Group for reading a JPEG file and converting it to a bitmap. The JPEG routines have been compiled into a Power++ Library (WJpeg.lib) and can be accessed through functions defined in the WJpeg.hpp file. See the WJpeg.hpp file for further documentation. A sample project is included which demonstrates usage of this class / library. This updated version adds the ability to convert jpeg images embedded in user-created image libraries and the ability to convert jpeg images embedded in WBuffer objects.
Written by Michael Lindell - LARGE_INT
arithmetic for Power++ (10KB)
This is an adaption of the Microsoft LARGE_INT arithmetic for Power++. More specifically, it is an adaption for Power++ of the following files: largeint.asm, divlarge.c and largeint.h from the Win32Sdk of Microsoft, dated 04.09.1994.
Written by Herbert Menke - WListView
HeaderControl Tracking (13 KB) P++ 2.0 And Up
There was some demand in the Power++ discussion list for the tracking events of the header control in a listview, and so this example program was made. It adds the following Events to the listview header:- WColumnHeadingBeginTrack: disabling tracking of a column
- WColumnHeadingTrack: limiting the width of column
- WColumnHeadingEndTrack: notify the end of tracking.
Written by Herbert Menke - Listview
Tooltips (7 KB) P++ 2.0 And Up
Sometimes a programmer wants to provide some additional information to a listview column that does not warrant an extra sub-column (i.e. the corresponding state for a phone number). This little example shows how the setup works. It provides tooltips for individual listview items. It has been tested only in listview report mode, but there shouldn't be any reason why it wouldn't work in the other modes as well.
Written by Jens Carroll - MetaKit
(140 KB) P++ 2.1 And Up
Use MetaKit to manage your application's data. Portable C++ classes for persistent storage & transport of highly structured containers. For more information, visit the library's home page.
Submitted by David Zabel - WModuleEx
Class (32 KB) P++ 2.1 And Up
WModuleEx is an extension of the WModule class. The new method Callproc makes it possible, to call a function in a Dll loaded at runtime on the fly. There is no need to create for each function a typedef. module.CallProc( WMCTStdCall, WTEXT("DllGetVersion"), returns, 1, &version);
Written by Herbert Menke - NT
Service Template (10 KB) P++ 2.0 And Up
This template allows you to easily create NT Services. Most service-specific API's are hidden in the template, so you normally will only need to implement your functions. This template uses the WIN32 SDK, so you must either have the Professional/Enterprise version of Power++ or get the SDK from some other place (see platform SDK above). Just unzip the zip-file in a temporary directory. Copy the "NT Service" directory to the location where you have installed Power++ in the subdirectory "TEMPLATE\TARGET". You will then be able to create a new target based on the NT Service Template. Please see the NT Service Template home page for more information.
Written by Andre Schild - Masked
Textbox Date Fix (1KB) P++ 1.5
The implementation of WMaskedTextBox in Power++ 1.5 does not handle dates correctly when bound to a database. In particular, it doesn't realize that dates are always in JIS (yyyy-mm-dd) format when coming from ODBC. This code allows you to make a masked text box that properly converts the data back and forth.
Written by Eric Giguere. - MenuSelect
Class (38 KB) P++ 2.0 And Up
This is a neat class which lets you easily manage how the statusbar updates to reflect menu items being selected (either in your main window menu, or in a popup menu). It also handles clearing the statusbar when a menu item is no longer being selected which is otherwise a non-trivial task. The class comes along with a sample program to demonstrate its use.
Written by Herbert Menke - Menu
sample (42KB) P++ 2.5 And Up
The Menu is a sample with shows how to create a menu that mimic the menu of Microsoft Word and co. Unfortunately the measure-method doesn't work as it should be. If you know a way to correct this please mail me.
Written by Markus Doppelbauer. - Minimize On
Start Fix (4KB) P++ 1.0 / 1.5
Power++ 1.5 and earlier have a problem with Resize Percentages conflicting with a program starting up minimized (when started from a shortcut that is set to run the program minimized). This code fixes the problem. Just follow the instruction in the readme.txt file, and your program will have no problems when started minimized.
Written by Shamim Islam - MinimumTrackingSize
with a MDIChild (1KB) P++ 1.5
The MinimumTrackingSize property does not work for MDI child forms in Power++ 1.5. Following the procedure in this text file, you can work around this problem.
Written by Ivan Bowman. - TreeViewMultiColumn
(90 kB) P++ 2.5 And Up Updated 2002.05.13
Old version (2001.03.02) still here
Better drawing; the left column is never bigger painted than the left header-column.
Here a classfile who allows you to use Multicolumn treeviews. A sample application is included as well. It's use is defined via the extended classfile setup and can be used in all places where you did use a treeview previously.
Update: In this update only the invalidated rectangle is redrawed and (as a new feature) it's now possible to mix/match multicolumnitems and normal items.Written by Markus Doppelbauer - MultiPad
Sample Program (17KB) P++ 1.5 And Up
Updated Version P++ 2.0 And Up
This program was written as a nice and simple replacement to Windows Notepad. It makes use of an MDI (Multiple Document Interface), which allows you to easily open multiple text files, and copy-and-paste between them, or compare their contents. You can also open files by dragging them from windows explorer onto the program. The program also demonstrates printing using Power++, along with many other features. Update: The updated version contains new features such as specifying fonts, doing a search/replace, loading/saving RTFs (as well as TXTs) and more! (The updated version requires P++ 2.0)
Written by Dave - NetManage
Mail Client Update (68KB) P++ 1.5 And Up
The original program by Alan Armstrong (see above) did not format the mail headers correctly with some versions of the NetManage controls, so the program could never send mail. This has been corrected in this version and is compatible with Optima++ 1.5 and Power++ 2.0.
Written by Rahim Pira - Noncollapsible
TreeView Sample (9KB) P++ 1.5
This sample program uses code provided by Ivan Bowman to implement a tree view which can prevent the user from collapsing a branch. The sample makes use of the Advanced Class Definition feature of Power++ 1.5, and requires the Win32 SDK. Note that this is a work around that won't be necessary in Power++ version 2.0.
Code by Ivan Bowman / Sample by Bill Klein - NViewLib
Example (152 KB) P++ 2.0 And Up
This is a sample program which demonstrates usage of NViewLib - free DLL written by K. Nishita. The DLL allows you to load JPEGs, GIFs, and other image formats into your application. The DLL is included with the sample program, but you can also get it from the source (and can check there for updates), at http://einstein.ae.eng.ua.edu/nishita/Download.htm#NViewLib.
Written by Michael Lindell - Object
Thunking (15 KB) P++ 2.0 And Up
Using a class member function as a callback function is not trivial, since a class member function must be passed as an implicit pointer to the object it is associated with. Object thunking is a method used to associate a callback with an object. The thunk (a dynamically piece of code) adds the this pointer on the stack and jumps to the member function. The included article describes how to use C++ class member functions as callbacks, as easily as to use static functions for callbacks.
Written by Herbert Menke - WOptionTree
(69 KB) P++ 2.0 And Up
The Common Controls are a tool kit for creating new controls. WOptionTree uses the state imagelist and the custom draw method for creating a treeview control, that is a 'container' for checkboxes and optionbuttons.
Written by Herbert Menke - Owner-Drawn
List Box Example (39KB) P++ 1.0 And Up
Explains how to implement owner-draw listboxes on dialogs. Includes pre-built executable so you can try it right away. - Owner-Drawn
Tab Control Example (10 KB) P++ 2.0 And Up
This example shows how to make a simple owner-drawn tab control so that you can specify the background and foreground colours of the tab control's tabs and their text respectively. Check out November 23rd's Power++ Tip for more information.
Written by Bill Klein - Position
To form template (72 KB) P++ 2.0 And Up
The Position-To form is designed to display and navigate large data files for record selection. Some of the features: Can be used for any database and any columns in the db without modification. Allows you to re-position the list at any time via the PositionTo function or the form's combobox. Positions the scroll bar button according to the first character of the selected item. Generates an event when a record is selected. You can specify which columns will be displayed and the relative size of each column in the lv. Supports re-sizing. Click on the column header to sort by that column.
Written by Al Kaiser - PowerBar
(233 KB) P++ 2.0 And Up
PowerBar is a simple Power++ toolbar application that can be used to clean up your desktop. It allows up to 11 tabs each of which can have up to 12 buttons that can be set up to replace your desktop shortcuts. You can use drag and drop from explorer or the desktop to add new buttons. Tap the top border to hide the toolbar, then tap again to open it. All source code is provided. See the included Readme.txt file for more information.
Written by Al Kaiser - Printing
Example (9 KB) P++ 2.0 And Up
How do you print a text file from Power++? This example allows you to choose a file and print it. Before printing it calculates the total number of pages and incorporates the range into the print dialog. User selectable lines per page and characters per line (line length) are also provided. Note that there is minimal error checking but this should be a good starting point to incorporate into other programs.
Written by Glenn Pope - PrintWXF
(77 KB)
For Power++ version 2.0 files. Requires P++ v2.0 DLL's. The author of this program has never been able to use the print option in the P++ editor. It's never worked on his old dot matrix printer. You can just print the generated source but that includes too much unwanted pseudo-code. This little utility prints code from the P++ project files. Just drag and drop any number of .wxf, .wxc, .w~f, or .w~c files into the window and they will be printed to either a disk file or directly to the printer (LPT1), bypassing all windows print queues. There's also an option to sort the functions by name. Updated: the source code included in an encrypted ZIP file is now available for all! The password is "Confucious".
Written by Al Kaiser - ProcessView
Example (99 KB) P++ 2.0 And Up
This is an adaptation of the Win32 SDK example program PView95 which views the different processes. It has been modified to work with the Power++ framework. It is an example of using the Win32 SDK and exceptions in Power++. Note that the Win32 SDK is required to compile this.
Written by Johannes Diedrich - Query
Class Extension (2KB) P++ 1.5 And Up
This is a simple extension to the Query class. With it, you can access columns via the column-name instead of column-index using GetSValue and SetSValue. The prototype is the same as the original GetValue and SetValue, only the first calling parameter is a WString instead of WShort. Changes: This update version of the class includes a seek function. The new seek function enables you to search for a column content on a complete query result set.
Written by Rolf Rother - QuickExplorer
(10KB) P++ 2.0 And Up
This is very useful little sample program, and the way it works is pretty cool too. When not in use, the program remains as a thin line on the right side of your desktop; when you want to call up the program, you simply pass the cursor over to the right side of your monitor, and the program's window pops up. The program itself has a drop down combo box of the most frequent folders you like to access, and with the click of a button you can bring up the desired folder in explorer. Leopold Toetsch has also made available an updated version of the program (originally by Dave Fladebo) which changes some behaviour of the program: On NT 4.0 the minimum width of 3 pixels didn't work (changing some style bits helped), you can now move the form up and down and it will remember where you put it, the form has been moved to the left side of the screen, and an Always On Top choice is now available.
Written by Dave Fladebo - RegisterControl
Function (1.1KB) P++ 1.0 And Up
This is a function which makes use of DLLRegisterServer in order to register an ActiveX control (OCX), or DLL file with the system. Requires the Windows SDK if you wish to make use of the error constants.
Written by Ivan Bowman. - Registry
Manipulation Example (8.2KB) P++ 1.0 And Up
This is a program, with source code included, written in Power++ that shows you how to manipulate the Win 95/NT registry. Its behavior mimics the Add/Remove program in Control Panel under NT4 or Win 95.
Written by George - Restored
Rectangle Sample (8KB) P++ 1.5
A GetRestoredRectangle function is used in this program in order to retrieve the restored size and position of the window. This is handy when you want to save the size and position of the window when the user exits the program. If you just get the window's rectangle, you might be getting its size when it is minimized or maximized (depending on the current state of the window). Note that you need the Win32 SDK to compile this program. This function has been exposed as a WindowPlacement property in version 2.0 of Power++.
Sample by Bill Klein, Code by Ivan Bowman. - RSASignature Sign a string with RSA (137KB) P++ 2.x
Sign a String with RSA. The code uses BeeCrypt http://www.virtualunlimited.com/products/beecrypt/
Code by Michael Doppelbauer . - Serial Communicaton
Class library (71kB) P++ 2.5
A class who encapsulates all the nasty win32 API calls for serial communications. It is implemented native with api-calls, not via a active-x control.
A example of a simple chat application via serial line is included.
A must-have if you ever want to access the COM-Ports of your PC from P++ applications.
Submitted by Kon Tantos - SciTech
MGL 4.0 (Web Site)
SciTech has released the SciTech MGL 4.0 graphics library, free of charge, with full source code! This is the same library that was used to develop titles like WinQuake, Hexen II and others. SciTech MGL 4.0 has many new features including the Game Framework for easy game creation, full OpenGL support for 3D acceleration, a sprite library for managing hardware and software sprites, transparent support for stereo glasses, hardware triple buffering and many others. SciTech MGL is a professional graphics library for creating high performance, interactive graphics applications on PC's.
Submitted by Herbert Menke - SHA1 algorithm (2 kB) P++
class
This class encapsulates the SHA1 encoding/decoding. SHA stands for Secure Hash Algorithm and has been developed by NIST along with NSA. More details on SHA1 can be found here at www.w3.org
A small test appication is included here TestSHA1.Zip
Submitted by Kusl Martin - AVI in the Statusbar (81 kB) P++
sample
This sample shows how to display a AVI Video in the statusbar of a form.
Submitted by Markus Doppelbauer - WRichTextBoxEx
Class (15 KB) P++ 2.0 And Up
Included in the ZIP file is the WRichTextBoxEx, as well as a sample project demonstrating it's use. WRichTextBoxEx is an Advanced Class which inherits from the standard WRichTextBox. It supports, in the first version, printing RTF text in the WCMMText Mapping Mode, and WYSIWYG formatting. Inserted graphics in the RTF file are printed, but for now you cannot insert them with the WRichTextBox component. See the WRichTextBoxEx class for documentation and well as the sample project for details on how to use it.
Written by Herbert Menke - RTB
Syntax Highlighting Sample (14 KB) P++ 2.0 And Up
This sample demonstrates in a simple way how you can integrate syntax highlighting in your editor application (or similar projects). But you have to know that this sample code should be optimized! If you've done it in a better and faster way than the code written by the author, please send it to him.
Written by Anselm Garbe - RTF Resource
Sample (8KB) P++ 1.5 And Up
This sample demonstrates including an RTF file in your program's EXE file as a resource, to be loaded in to a WRichTextBox control when you wish. This is nice if you do not wish to include the RTF file with the distribution of your program.
Written by Bill Klein - Server Sample
(16KB)
This is a small sample server program written in Power++. It accepts connections, and then sends the input to a listbox.
Written by Shaun Savage - Smart
Form Validation (20 KB) P++ 2.0 And Up
The ZIP file includes a document which describes the problems and special cases of a field-level validation in Power++ forms, but also a technique, Smart Field Validations, for how to implement painless validation. The source of WFieldValidation and a sample is included. For compiling, the Win32 SDK is needed.
Written by Herbert Menke - SMTPMail
Class (3 KB)
This is a useful e-mail class which was originally written by a peer that has been enhanced to be RFC 821 compliant. It was written completely using Power++ components only. The class lets you send an e-mail using a single call to the function SendMail(). It is necessary to edit the class to put in the address of your mail server you wish to send through.
Written by Gregory Dirst - Speech
Class (52KB) P++ 1.0 And Up
This is a Speech Class which lets you use IBM Voicetype from within your Power++ applications. With it, you can enable voice control over any Power++ program you make!
Written by Rolf Rother - Stream
Class (7KB)
This is the WStream class made for Power++ - it has been tested using Power++ version 1.5. The author created it after realizing that only istream and ostream are included with Power++, and they were not adequate for his purposes. The package comes with the WStream class and the WFile class which is derived from WStream.
Written by Markus - Super StatusBar Example (8KB)
P++ 1.5 And Up
This a sample program taken from Issue 10 of Dr. Power++. It shows you how to make a status bar which is divided into different parts, and then add components to those parts. Specifically, in this example, a progress bar is added to one part of the status bar, and an icon is added to another part.
Written by Dr. Power++ - SysTray
Class (2KB) P++ 1.5 And Up
WSysTray is an Power++ class which lets you place an icon in the system tray. You can associate a menu with the icon, and can also have the default menu item execute with a double-click on the icon. It was contributed by Ivan Bowman of Powersoft, but neither he, nor Powersoft support the code, and will therefore not answer any questions regarding it. To use this class you must have access to the Windows API header files. The latest update fixes a problem with SetTip() - thanks to Chris Johnson for the fix! In this updated version of the component by Herbert Menke, some minor bugs have been fixed, usage has been simplified, and some extensions have been added: Icon and Tooltips can be changed at runtime, the systray icon can be removed when the formtray is popuped, the x button of the formtray can have the function as the minimize button.
Written by Ivan Bowman. - SysTray
Example Program (11KB) P++ 1.5 And Up
This is an example program which makes use of the SysTray class (available above and included with this example). The example shows how to set up a tray icon, and assign popup menu to it. It also demonstrates how to assign event handlers to the icon. The latest update fixes a problem with SetTip() - thanks to Chris Johnson for the fix!
Written by Bill Klein - Text
Search Algorithms Example (119 KB) P++ 2.0 And Up
This is a sample program which compares the speeds of several search algorithms including: Brute Force, Boyer-Moore-Horspool, Quicksearch from D.M. Sunday, TSearch (an optimized version of Quicksearch), and a few variations of strstr. QueryPerformanceCounter and __int64 is used for timing the different methods. In this updated version, the ZIP file contains a folder called OptimalSearch which contains a class that makes use of QStrStr (an optimized BMH search), QStrIStr (the same thing base case insensitive), StrStr (the Microsoft strstr), and StrIStr (same thing but case insensitive). The fastest is QStrStr, but StrStr is faster, if the length of substring and/or of the string is unknown and the size of string < 500 KB. If the buffer is smaller than 500k, often strlen eats more time than the search algorithm.
Written and submitted by Herbert Menke - Toolbar Class
(3KB)
This useful toolbar class, which is derived from WToolbar, was designed to make using toolbars easier in Power++. Using this class, you do not have to worry about manipulating the WToolbarItemInfoArrays - it is all handled internally. Also, this class has built in support for adding the new Coolbar (a la IE3) look to your toolbars.
Written by Joby Allen - Towers
of Hanoi (18 KB) P++ 2.0 And Up
The author of the program got curious and pieced together this small program that demonstrates several things. How to animate objects, using the WCStack template and recursion. It is based upon the classic game "Towers of Hanoi" which is an often-used problem to teach CS students about recursion. In this updated version of the code, the animation has been slowed down and has been made customizable by a delay so it looks nice on fast computers, and the recursive routine as been placed in a separate thread. This allowed the enabling of the stop button during an automatic run.
Written by Glenn Pope - WTrackMouse
(11 KB) P++ 2.0 And Up
WTrackMouse is a helper class, that wraps the TrackMouseEvent function and simplifies the use. After associating the window and calling the Start() method, a WTrackMouseEvent is send whenever the mouse enters or leaves the associated window. For Win95 the TrackMouseEvent function is handled by WTrackMouse itself.
Written by Herbert Menke - WTrackingToolTip
(50 KB)
WTrackingToolTip shows how a tracking tooltip can be used to show the current thumb position of the vertical scrollbar. Version 4.70 or greater of comctl32.dll is needed.
Written by Herbert Menke - Transparent
Bitmap Example (10KB) P++ 1.5 And Up
This sample demonstrates using the Windows API to draw a bitmap onto a canvas, masking one colour as transparent. Take a look at the Paint event of the form to see how this is done. Requires the Win32 SDK to compile.
Written by Todd Porter. - Treeview
Drag 'n Drop Example (13KB) P++ 1.5 And Up
This is an example program which demonstrates using drag 'n drop from an item on a treeview to another item on that same treeview.
Written by Ready Software. - Value
Vector Container Example (11 KB) P++ 2.0 And Up
One of the more powerful Classes/Templates found in the Watcom C++ Library that comes along with Power++, is the Watcom Vector Container. Trying to decipher the supplied Watcom C++ help files to a concrete example is one of the most difficult tasks a new programmer would be faced with. The example provided here shows a working example that will, hopefully, allow someone to take advantage of this tool. The example is setup to provide timing for building the table and for searching the table. Also see HashTable Example.
Written by Glenn Pope - Wallpaper
Example (9KB) P++ 1.5 And Up
This is an example program which demonstrates opening and reading the registry, file drag & drop from explorer, and using the Win32SDK.
Written by Dave Appleton. - Watcom Project
Explorer (246kB) P++ 2.5 And Up
WPJ Explorer can explore Watcom project files and its targets. It shows the properties of a project and the dependencies of the source files. The properties and the dependencies can be exported to a text file. Also a list of all files, that are used in the project is shown and can be copied to another directory. If the option "Parse project files for filenames in string literals" is select, all source files are scanned for filenames in string literals. Remark: The application is not optimized for speed.
A compiled executable is included as well
Written by Herbert Menke. - WXFSort
(64 KB) P++ 2.0 (tested)
This is a useful hack for sorting User Functions in a Power++ project. You can select a WXF file by using the open option or you can drag and drop from explorer. Once selected into WXFSort, the user functions can be sorted by function name and/or individual functions can be moved via the up/down buttons. When the save option is selected, WXFSort will create a backup file ("FormName.BAK") of the original and then create a new WXF file with the functions in the new order. Note that if the backup file exists, it will be deleted without warning. Please read the Readme.txt file included before using!!
Written by Al Kaiser - WxViewer
(70 KB) P++ 2.0 And Up
WxViewer shows a clearly laid out view of a Optima++/Power++ script file. It parses a script file and stores the values in a tree. A treeview component is used to display the values from the tree. The program can be extended, to modify the values and write the changes back to disk. All script formats are supported: wxc, wxf, wxt, wxp, wxr, wxu wxi and wxm. If you want to compile the program yourself, the Win32 SDK is required, but a compiled EXE is provided as well.
Written by Herbert Menke - GNU Zip library
(146KB)
This library provides functions to zip and unzip files via the gzip algorithms. (Available in opensource and widely used in unix based systems). The extension of the compressed files is usually .gz (GnuZip)
A small sample aplication is included. Written by Markus Doppelbauer. - ZoomIn
Program (14 KB) P++ 2.0 And Up
This is an adaption of SDK tool Zoomin to the Power++ Framework. Zoomin is a tool designed to magnify selected sections of the screen. This allows you to view pictures more closely and examine windows to detect errors in the graphics. With Zoomin you can also watch a program, while magnified, paint its windows to detect subtle errors. Requires the SDK to compile.
Written by Herbert Menke
Remember, this web site is here for you and people like you. So if you
have anything that others might find useful, let me know, and I'll
post it here. E-mail me, Andre Schild at
a.schild(at)aarboard.ch, or fill
out the form at the bottom of the main
page.
Hope to hear from you soon!
Back to Absolute Power++.