devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

More about sizeof() operator

Question: I’m using the sizeof() operator to find the length of my integers just like the Q&A section said, but it consistently returns a 4 regardless of integer length. What

List Files With FileSystemObjects

One of Visual Basic’s handiest functions is the Dir function, which allows you to find all the files with a given filespec. VBScript does not have an identical function, but

Display the Stack Trace

The stack trace is a useful debugging tool that you’ll normally take advantage of when an exception has been thrown. It provides information on the execution history of the current

Serialize Image Instances

The java.awt.Image class does not implement the java.io.Serializable interface. As a result, attempts to serialize or “marshal” instances of the class will fail. For example, they cannot be passed as

Create Custom Hotkeys in Visual InterDev 6

Visual InterDev 6 installs with its own keyboard mapping scheme, which you can customize to suit your preferences. For instance, you may want to use the F12 key from within

Determine Total and Available Memory

If you find that your Java programs are starting to use too much memory, there are methods available that can help you diagnose how much memory is allocated. The freeMemory()

Determine Absolute Cursor Coordinates

When a component event such as a mouse click occurs, Java provides the cursor coordinates relative to the top left corner of the component in which the event took place.

Friends Should be Declared Public

The compiler ignores the access specifier of friend functions. However, you should declare them as public to make the code readable: bool operator ==( const Date & d1, const Date&

Dynamically Create Selection Box Options

You can create selection box options dynamically using JavaScript 3.0’s Option object. The syntax for its constuctor is: Option(text, value, [default selected], [selected]) Here is an example:

Empty Exception Specification

Some programmers tend to add an empty exception specification to constructor destructor, assignment operator, and copy constructor of a class: class C {public: C() throw(); ~C() throw(); C(const C&) throw();

Use Unadvertised Controls

When you open VB5’s Components list, you’ll see many controls and libraries not available for your development. Some are controls you downloaded from Web pages; others come from who knows

Overloading Operators for enum Types

For some enum types, it may be useful to define overloaded operators, such as ++ and –, that can iterate through the enumerator values: #include using namespace std;enum Days {Mon,

Const and Reference Data Members Must be Initialized

A class may have const and reference data members. These members must be explicitly initialized by a member-initialization list: class Allocator{private: const int chunk_size; const string & serialization_path; // file

Activate Single Control on All Tabs

A single object, employing a single set of event routines, may be used across all pages in the SSTab control. Draw the object on the form that contains the SSTab

Delegate Generic Event Handling

It can be useful to create generic controls of similar properties. For example, if a project has 10 textboxes on different forms that need to accept numeric input only, instead

Easily Determine Whether a Recordset is Empty

Use this quick and dirty routine to help find empty recordsets: Public Function IsEmptyRecordset(rs As Recordset) As Boolean IsEmptyRecordset = ((rs.BOF = True) And (rs.EOF = True))End Function

Remove Unwanted Characters

When working with or fixing Access databases and Excel spreadsheets created by users at my company, I often have to use their strings from the table or spreadsheet to save

Executing a File Selected in Filelistbox

Question: I am trying to work out the coding to execute a file that I select in my filelistbox in Delphi 4. Can you help me? Answer: You can refer

Shared Database Session

Question: Is there a way to share a database session between calling application and DLL? Not having such a sharing (DLL with DataSet components) increases the number of SQL server

Trying to Modify an Original Program

Question: I commissioned a program that was written in Delphi. I am not a programmer, but an excellent hacker. Is there any way I can get into this program to

Fixed-Width Tables in IE5

Internet Explorer version 5 has significantly better HTML table support than previous versions. Up until now, HTML writers have had to rely on trial and error to make tables render

A Runnable Is Not a Thread

You may come across some situations where implementing a Runnable may have some advantages over extending Thread. If the class you are going to multi-thread is already extending another class,

Declaring Variables Inside an If-Condition

C++ allows you to declare variables just before their use rather than at the top of the enclosing block. Thus, it is legal to declare a variable inside the condition

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

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

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.