The Latest

DevX

Text Orientation in a Bitmap

Question: How is it possible to write a vertical text (with TextOut procedure) in a bitmap (Delphi 2)? Answer: I know how to do this with a TLabel descendant, but

DevX

Running other apps from a C++ app

Question: I recently started programming with Borland C++ Builder and the help files aren’t much help at all. I would like to know what the code is for executing another

DevX

Mixing delete and delete[]

Question: I am programming with Visual C++ 5.0 and the class library StarView from StarDivision.Looking at the Source from StarView, I found bad code: void** p = new (void*)[100];…delete p;

DevX

Include a Hits Counter Using ASP

If you’re using Internet Information Server with Active Server Page technology for hosting your Web site, here is a simple way to include a hits counter and the date the

DevX

Highlight Comments in your ASP Pages

If you’re using IIS 3.0 with Active Server Page technology for hosting yourWeb site, here is a very simple way to highlight comments in your ASP pages andreduce page download

DevX

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

DevX

Max Calculation

Question: How do you select the maximum value of a column in a DBGrid when displayed through a query? (query SQL:select max(CustNo) from customer, and get error message:”the table is

DevX

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

DevX

Error Creating Window

Question: In my Delphi 1.0 application, when I open a form (e.g. ClientForm.Show) I get an error message: “Error creating window.” This error occurs when several forms (nine or ten

DevX

Access Violation Error

Question: I developed a database using AS400 components. Everything compiled and it was working for awhile. I have not changed anything in the project and now whenever I close the

DevX

Recommended Delphi Books

Question: I am looking for a good introduction book to Delphi. I know Turbo Pascal, but I am still a beginner in the field of OOP and in the field

DevX

Computing Number of the Week

Question: I want to compute the number of the week. Thanks in advance PLM Answer: This is pretty basic stuff. If you want the current week of the month, a

DevX

Delphi SQL Parameters

Question: Is it possible to use a parameter on the left side of an equality in a WHERE clause? For example: SELECT * FROM TblName WHERE:parm1 = :parm2 When I

DevX

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

DevX

Getting Application List

Question: How can I get a list of currently running applications and, more importantly, handles to their windows? Answer: For that you have to use the Windows API call, EnumWindows.

DevX

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

DevX

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

DevX

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

DevX

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 &

DevX

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.

DevX

OnMouseOver

Question: How can I change the color of a URL link when the mouse passes over the link? I am using Netscape version 3.0. Answer: Unfortunately, you need to have

DevX

Year 2000K Compliant

Question: How do I make my date and time JavaScript Y2K compliant? Thank you. Answer: To the best of my knowledge, JavaScript, the language, is already Year 2000 compliant. Internally

DevX

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.

DevX

Access 2.0 to Visual Basic 5.0 Conversion Product

Question: Is there a product to convert Microsoft Access 2.0 applications to Visual Basic 5.0 applications? Answer: Unfortunately, Access forms are significantly different than Visual Basic forms (in any version,

DevX

How to change a picture format to JPEG

Question: I have recently bought a scanner and now have the capability to put pictures on my computer. How do I save pictures in JPEG format instead of bmp format.

DevX

Be cautious with unsigned integers

Unsigned integers are sometimes unavoidable, like when dealing with raw binary data. A good example is a mail server reading an incoming binary stream. But more often than not, the

DevX

A template’s template argument

Standard C++ supports templates’ template arguments. For instance, a mail server class can store incoming messages in a vector of vector(s) of bytes: vector< vector > vmessages; Please note that

DevX

Structs as a shorthand for public classes

Traditionally, structs serve as data aggregates. However, in C++ a struct can have constructor(s), destructor and member functions just like a class. The only difference between the two is the

DevX

Hiding a base class member function

A derived class may hide a member function declared in its base class by using the same function name, but with a different signature, or list of arguments. Usually, this