Tip Bank

DevX - Software Development Resource

Avoid Obsolete Win16 Memory Functions

The 16-bit operating systems Windows 3.1x and DOS had a very intricate memory model that required the use of functions like GlobalAlloc() and GlobalLock(). These functions addressed a specific problem

DevX - Software Development Resource

The getenv() Function

The ANSI function getenv() returns the value of an environment variable. getenv() takes a C-string containing an environment variable and returns its value. In the following example, getenv() detects the

DevX - Software Development Resource

The ssize_t Typedef

The standard typedef name size_t represents a platform-defined unsigned integral data type. If you’re a Unix or Linux programmer, you may have come across another similar typedef, namely ssize_t. This

DevX - Software Development Resource

Embedding XML Data Islands in HTML

There are two ways to embed a data island into an HTML document. The first is inline, where the XML data structure is surrounded by the tags. 3345 Deepak Pant

DevX - Software Development Resource

Returning Data Structures from Functions

Question: I’m working with a CCS compiler for the PIC16F877, so the rules may be different, but I’ve created my own data structure (named MERIT_long) to support >16bit values (CCS’s

DevX - Software Development Resource

Select All Text

Question: How do you automatically select all text in a TextBox when it receives the focus? Answer: For a text box named Text1 you can use the following code: Private

DevX - Software Development Resource

Memory Deallocation

Question: I have a byte pointer pointing to a message buffer. I want to know how can I delete just the first two bytes of this message and pass on

DevX - Software Development Resource

STL Thread Safety

Question: Does STL use any synchronization, or do I have to implement it myself by critical section? Answer: The C++ standard doesn’t specify whether STL is thread-safe or not (which

DevX - Software Development Resource

Checking for Characters

Question: I want to call another function only if the key pressed is a letter. Is there a way to check whether the key the user has typed is a