devxlogo

Tip Bank

ListBoxes and ItemData

Question: How can I expose the ItemData property of a ListBox to use it for storing longint data that corresponds to each item in the list in Delphi 3.0? I

Parameter Passing

Question: I am writing a program that needs to keep a running total of ID numbers allocated for this reason. The ID numbers are in an auto-increment field. I need

Multiple Inheritance

Question: I read somewhere that Object Pascal, the language used in Delphi, does not support multiple inheritance. Is this true? Answer: Yes, this is true. Object Pascal’s inheritance model follows

auto_ptr<>: your safe guard against memory leaks

The Standard Library supplies the class template auto_ptr which automatically deallocates heap memory. Likewise, local objects are reclaimed in case of exiting their scope or during “stack unwinding” caused by

extern “C” linkage declaration

It is not uncommon for C++ code fragments to be called by non-C++ programs such as a C-based communication software, COBOL based TP monitors and the likes. However, global functions

Exception-free version of operator new

Operator new throws an exception of type std::bad_alloc when it fails to allocate the requested amount of memory. Yet in some circumstances, or due to performance considerations, throwing an exception

That’s what friends are for

A class can declare external functions or other classes as friends. Friendship grants full access to all of the grantor’s members, even private and protected ones: void encrypt (string &

Quotes

Question: How do I display a quote through scripts? For example, I want to print the quotes in a line but JavaScript reads the quotes as part of the coding.

Search Hard Drive

Question: I need a script that will allow users to search their hard drive for a file that they can send me. If you can help, I’d appreciate it! Thanks.