devxlogo

The Latest

Creating Objects

Question: I am having problems creating one particular ActiveX object using ASP. Previously I used WinCGI, and could create the desired object without any trouble. Trying to create the same

Start Menu

Question: When I start my PC, the first thing on the screen (after the virus scan)is Internet Explorer. Then I get a navagation cancelled box. How do I stop IE

Configuring a CD-ROM

Question: I have formatted my machine, which does not have any operating system. I used DOS 6.22 to boot the system and was planning to install Win 95. But my

Passing Arrays

Question: Can you pass an array directly into a cookie file, or do you have to convert it to a string first? If you have to convert it to a

Copy to Clipboard

Question: I want to copy some text in an HTML page to the clipboard when a button is clicked. Is there a method to do this in an onClick event?

Network Protocols — NetBeui

Question: What would happen if I removed the basic NetBeui protocol on an NT network and enabled TCP/IP as the lone and default one? Is that advisable? Answer: As with

Logging in to WinNT4.0 Svr

Question: Some of my users cannot logon to a new WinNT 4.0 server with the standard account I have created for them. Some users get the logon dialog box that

Inserting Text at Cursor Position

Question: How can I insert text in a textarea at the current cursor position ? I am able to insert it at the end, for example: textarea.value = textarea.value +

Creating Directories

Question: Is there any way to create a directory from within a PowerBuilder application without using the RUN command? Or is there a way to get the RUN command to

NT 4.0 Resource Kit

Question: I have been told that the NT 4.0 Resource Kit has a tool to turn an executable, such as one created in VB5, into a service running on NT

Streaming Media Bitrates

Question: Do you know of any way to find out the connection speed of a site’s visitor and then stream videos at the appropriate bitrate? I’m thinking specifically of RealPlayer.

Set Printer Margins

You can use the Printer’s scale properties to set margins. Set the properties so the position (0, 0) is mapped to where you want the margins. This code makes the

Make a Form Stay on Top

You can make a form always remain above others, even when it does not have focus. Use this code in a BAS module: #If Win16 Then Declare Sub SetWindowPos Lib

Perform One-Time Initialization

You can use static variables to perform one-time initialization: Private Sub GetValue()Static initialized As Boolean If Not initialized Then ‘ Perform one-time initialization. : initialized = True End If ‘

Use Explicit Object Types for Speed

It is much faster to use explicit object data types instead of generic ones. In this test that simply sets an object’s public variable, the generic object takes more than

Create Global Properties

You can create property procedures in a BAS module. The rest of your program treats the “property” like any other variable, but the property procedures can perform error checking and

Error ‘ASP 0115’

If you are developing in Visual Basic for Active Server Pages (ASP), there are two likely causes of an error ‘ASP 0115’. The VB5 setup wizard puts a number of

Hidden IP Address

One of the easiest ways to grab an IP address is to use request.servervariables(“REMOTE_ADDR”) and then store the value as a hidden field in your form. When the user submits

Creating Instance of InetAddress

InetAddress objects can be instantiated only by doing a hostname or address lookup by calling any one of the static lookup methods in the InetAddress. For example, to create an

Re-Throwing an Exception

An exception is thrown to indicate an abnormal state. The first handle to catch the exception can try to fix the problem. Should it fail to do that, or in

Returning Objects by Value

For efficiency reasons, large objects should usually be passed to or returned from a function by reference or by their address (using a pointer). There are, however, a few circumstances

Prefer Private Data Members to Protected Ones

Data members of a class are usually a part of its implementation rather than its interface. They may be replaced when the internal implementation of the class is to be

Use Multiple Inheritance to Conjoin Features

Derived classes can combine functionality of several base classes simultaneously, by means of multiple inheritance. Trying to achieve the same effect by using single inheritance can be very difficult, to

Local Classes

A class can be declared inside a function or a block. In such cases, it is not visible from anywhere else, and instances thereof can only be created within the

Sensing Browser Type

You can easily find out the browser type, version, and sometimes the operating system that your visitors are using by checking the userAgent and appVersion properties of the navigator object.

Prefer private data members to protected ones

Data members of a class are usually a part of its implementation rather than its interface. They may be replaced when the internal implementation of the class is to be

Microhelp and the Status Bar

Question: I’ve heard that the MDI Frame status bar can be subdivided so that multiple messages can be sent there. The only two methods of manipulating the status bar that

Using Animated GIF

Question: Can I use an animated GIF in my application? Answer: There is no simple way to use animated GIFs inside of PowerBuilder. However, there is a way that you