devxlogo

Tip Bank

DLLs and Dynamic Memory Allocation

Dynamic linking — either in the form of shared libraries in Unix or Windows DLLs — is not defined by standard C++. However, this is a widely used feature among

Obtain Exception’s Stack Trace as String

It is sometimes necessary to get the exception’s stack trace as String (for logging, reporting, etc.). Unfortunately, the Exception class itself provides only the getMessage() method which does not include

Variadic Macros

The concept of a variable argument list is rather common: void f(const char *format,

Provide

It is often helpful to provide a

Passing a UDT(User-Defined Type) Between Forms

There is a very simple way to get around the compile error when passing UDT (user-defined type) in procedure between forms. Just declare the procedure as Friend instead of Public.Example:

Resize the Column Headers to Fit the ListView

This function resizes the column headers to fit the ListView. It can be used in the Form_Resize event or just in Form_Load. ‘Module: Module1Option ExplicitPrivate Type RECT Left As Long

A Null Preprocessor Directive

An empty # sign is a null preprocessor directive. A null directive has no effect but you can use it to document your intentions, for example: ifndef HEADER_INCLUDED#define HEADER_INCLUDED#else# //