Technology and Community

Jim O'Neil

Subscribe to Jim O'Neil: eMailAlertsEmail Alerts
Get Jim O'Neil: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


PowerBuilder: Article

.NET Features Analyzer

Easing the .NET development effort

HOW'D HE DO THAT?

Adding Items to the File>New dialog

Adding your own custom utilities and links into the File>New dialog is fairly easy. As you may be aware, the information about your PowerBuilder 11 installation is stored at the registry key:

HKEY_LOCAL_MACHINE\Software\Sybase\PowerBuilder\11.0

You can creat a new subkey called CLSID and beneath that add additional subkeys in the form of Globally Unique Identifiers (GUIDs) for each of the items you want to include in tabs of the File>New dialog (see Figure 9).

The .NET Features Analyzer, for example, has a GUID of {9D64FE89-CC1E-4bb2-93A5-E4EAE5A1DC4A}. There are online tools as well as a Microsoft utility, guidgen.exe, which you can use to generate such a value. You can even generate one by using the "New" button on a COM/COM+ project object in PowerBuilder - and you don't have to actually save the project!

Once you've created the GUID subkey set the value for its default key and add three new keys as follows:

The value for the DefaultIcon key specifies the image that appears in the File>New dialog for your utility or link. The format of this entry is a file containing the icon resource and the index of that resource in the file separated by a comma. Many Windows system DLLs, such as shell32.dll, contain a host of images that you may find suitable. You can browse the images using a resource editor or by creating an arbitrary shortcut on your desktop and using the Properties>Change Icon option from the shortcut's context menu browse the files and images they contain. If you use this latter approach, start counting images with 0 and use a column-major numbering scheme, that is, count down in a column then across each row to determine the appropriate index.

The Tool registry key can be one of several values depending on the tab in which you want the link or utility to appear:

The URL can be expressed in a number of different formats, from a standard HTTP URL to a PowerBuilder-specific one. In the case of the .NET Features Analyzer, the target is a separate executable that happens to be a PowerBuilder application so the action begins with execute:/// (note, three forward slashes). The application to be executed must be expressed using its full path, and note that the colon character after the drive letter is replaced by the vertical bar or pipe character. For information on other types of hyperlinks that are possible, see the CodeXchange project entitled "Customizing the PB IDE."

Loading the Unsupported Features List from the PowerBuilder IDE.
Accessing the unsupported features list from an open PowerBuilder development session involves just a few Windows 32 API calls and a little bit of insight into how the PowerBuilder IDE is constructed. If you downloaded the source code for the .NET Features Analyzer from CodeXchange, pay particular attention to the n_pbide custom-class user object, which encapsulates this interprocess communication.


More Stories By Jim O'Neil

Jim is a Technology Evangelist for Microsoft who covers the Northeast District, namely, New England and upstate New York. He is focused on engaging with the development community in the area through user groups, code camps, BarCamps, Microsoft-sponsored events, etc., and just in general serve as ambassador for Microsoft. Since 2009, Jim has been focusing on software development scenarios using cloud computing and Windows Azure. You can follow Jim on Twitter at @jimoneil

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.