May 7, 1998

The Explicit Keyword

A constructor taking a single argument is by default an implicit conversion operator: class C { int I; //… public: C(int i);//constructor and implicit conversion operator //as well }; void

Mem-initializer Evaluation Order

When initializing objects data members by a mem-initializer list, the compiler transforms the list into the order of the declaration of the data members in that class: class A {

Avoid Using malloc() and free() in C++

The use of malloc() and free() functions in a C++ file is not recommended and is even dangerous: 1. malloc() requires the exact number of bytes as an argument whereas

Use Mem-initializer to Initialize Embedded Objects

If your class contains other object(s) as members, you should initialize the embedded object(s) in a mem-initializer list instead of assigning their values inside the class constructor: class Person {

A Few Remarks About Inline Specifier

All member functions implemented within a class declaration are by default inline: //file: A.hclass A { int a; public: int Get_a() { return a; } //declaration + definition; //implicitly inline

Debugger is not Being Invoked

When working on developing or debugging an app that is created via automation (i.e. ActiveX DLL), keep in mind the following: if you invoke that app from a calling program

VB Hijacks the Registry

Be aware that the VB IDE hijacks the registry settings for your public classes when working on projects such as ActiveX DLLs and Controls. The IDE will temporarily replace (in

Using Dim Statement on Variant Arrays

When passing a variant array by reference, make sure to use Dim to declare the statement before using Redim. Example: Private Sub Command1_Click()Dim x as integer ReDim v(2) As Variant