March 27, 2001

Reduce the Size of an ATL DLL

When writing an ATL DLL or an ActiveX Control DLL, developers used to take off the ATL_MIN_CRT. However, this action will increase the size of the DLL up to almost 30k. To avoid doing this, just change the string manipulation functions from C-style to C++ style by adding the character

An Essential Use For Explicit Typecasting

If one is not careful with implicit typecasting, one can get very weird results that are not easy to detect.Look at the code below: int number;.. //some computation and codeint result = number / sizeof(int);char * p = new char[result]; //using result For simplicity sake let

Make Collections Work Like Standard VB Collections

Add the following procedure to your collection object: Public Function Item(ByVal Value as Variant) _as SomeObject Set Item = mCollection.Item(Value) ‘mCollection is your private module level ‘collection object.End Function Now, make the Item procedure default with the Procedure Attributes dialog box. Open the dialog box from the Tools menu, click

Simple Filenames For Portable #include Statements

It’s important to remember that you may want to use your classes in future projects. Overtime class files may change directories, or your next program could be for use on a different platform. Mac compilers handle #include paths differently from other platforms. The result is that all your #includes should

The Difference Between Implicit and Explicit Copy Constructors

If there are no calls to constructors in the initialization list, an implicit copy constructor of a derived class always calls the copy constructors of the base classes. On the other hand an explicit copy constructor of the derived class (one defined by the programmer) will call the default constructors

Return Any Name String in Proper Capitalization

Function FormatProper(ByVal strName As String) As String’**********************************************************************’* Take any name string and return it in proper capitalization’********************************************************************** Dim strProperName As String Dim varProperName As Variant Dim intCount As Integer Dim i As Integer varProperName = Split(strName,

Animating the Window on Showing or Hiding

You can easily add animation when showing or hiding a window using the AnimateWindow API. There are three types of animation: roll, slide, and alpha-blended fade. The declaration of API is like this: Private Declare Function AnimateWindow Lib

No more posts to show