This provides for an easy way to generate key values for tables in a database when you don’t want to use a system generated value (like an IDENTITY column). The example is for MS SQLServer 2000 but could be adapted to any database which supports stored procedures. Note that this service assumes the key value…
You are currently browsing the post archives for December 2010.
PowerBuilder – Locating Windows folders
Here is an easy way to find the paths to the various Windows folders. oleobject lole_wshell lole_wshell = create oleobject lole_wshell.connecttonewobject( "wscript.shell") is_mydocspath = lole_wshell.SpecialFolders("MyDocuments") IF IsValid(lole_wshell) THEN Destroy lole_wshell /* other folders: AllUsersDesktop AllUsersStartMenu AllUsersPrograms AllUsersStartup Desktop Favorites Fonts MyDocuments NetHood PrintHood Programs Recent SendTo StartMenu Startup Templates */
PowerBuilder – Prevent Individual Column Resizing in Grid DW
Many applications I’ve worked on have grid datawindows that include columns which display graphics to indicate some sort of common functionality such as code inquiry, row selection indicator, etc. Generally you set the ‘display as bitmap’ property on the column and go from there. The problem with these columns, however, is if the user resizes…
PowerBuilder – Get Color Value of Pixel under Pointer
Here is a sample application which will give you the color value of the pixel the user clicked on on a picture control (this can be used for any object inherited from a dragobject). To see the list of draggable controls, open the Browser. All the objects in the hierarchy below dragobject are draggable. This…
PowerBuilder – Have Window Stay on Top
One common application technique is to have any notification windows stay on top of all others, even if subsequent windows are opened on top of them (and the notification window loses focus). This can easily be achieved via an external API call: SetWindowPos. From the MSDN: “Changes the size, position, and Z order of a…
PowerBuilder – Application Icon in the System Tray
One challenge for Powerbuilder developers today is the lack of current information/programming tips relating to more current (10 and above) versions. This also applies to Windows versions as well. There are a variety of different solutions to having an application icon in the System Tray but almost without exception they relate to Windows 95/98 primarily.…
PowerBuilder – Calling Methods on Separate Windows
If you need to trigger and event or call a function on another window within an application, here are two solutions. In you have an MDI application you need to get a reference to the sheet. The PFC has a method to get the sheets of a certain class called ‘of_getsheetsbyclass’. You call it and…