March 18, 1999

Load a Text File Into a Memo

Question: How do I read a file on the A: drive into my program and then display the contents into an edit box? Answer: I’m not sure you’d want to load the contents to an edit box, especially if it’s a large file. But if you use a TMemo, you

Descendants of TTreeNode Not Compatible

Question: I am having troubles with the TTreeView component and adding custom derivations of TTreeNodes to it. I want to define a new type of TTreeNode with a lot of extra parameters for my application (for example, an internal-timer for each item that does some polling, and so on) and

Refreshing the Desktop

Question: How do I refresh the desktop after I draw on it? Answer: Simple: call the Invalidate method for your form, and the window will refresh.

Type-Declaration Characters

Question: I’m having problems passing variables to an API function. I always receive a Type mismatch error. I reproduced the situation in Visual Basic and found that if I used type-declaration characters to declare the problem variables, they were compatible with the API function. So now, I have it working

Different Versions of Delphi and the BDE

Question: Is it possible to have two different versions of the Borland Database Engine (BDE) installed on the same machine? I’ve been developing in Delphi 3, recently went to Delphi 4, and discovered that the native MSAccess driver that came with BDE 5.01 is way too slow. I’d like to

Open Database Error

Question: I am updating an application that was developed to make an executable test version. However, the live database is opened, not a test database. I have made a test database for this purpose. When I run my new executable and it is loading the live database I get the

Drop Word Documents Into FrontPage 98

If you have a Microsoft Word document that you want to insert into an HTML page in FrontPage 98, you don’t have to open Word to convert to HTML. With your HTML page open in FrontPage 98’s editor, use Windows Explorer to drag the Word document and drop it at

Before You Define a Copy Constructor and Assignment Operator…

In general, classes that possess pointers, file handles, and other resources need a user-defined constructor to avoid aliasing. For example: class Person {private: int age; char * name;public: // the following three member functions must be defined by the class implementer Person (const char * name, int age); Person &

Writing an Event Producer

An event producer is also known as the “source” of the event. Java does not define a base class or an interface for the event producer. However, the Listener design pattern requires that the event source provide at least these two methods for adding and removing listeners for the event