Wednesday, May 30, 2007

When to use __fastcall

The __fastcall keyword should be used when a function is expecting parameters to be passed in registers. It must be used for all TForm methods. (see http://www.codepedia.com/1/CppBuilderFastcall)

This guy talks about it in a Win32 sense. He mentions that I buys little in a x86 world because of the limited register set. However, under the x64 calling convention this is not the case. (see http://www.nynaeve.net/?p=63). This guy, Ken Johnson, really seems to know what he is talking about.

Confusing Compiler Error Messages

If I leave the semicolon off a class declaration I get the following set of confusing error messages:

[C++ Warning] QuerySet.cpp(19): W8058 Cannot create pre-compiled header: header incomplete

[C++ Error] QuerySet.cpp(20): E2111 Type 'QuerySet' may not be defined here

[C++ Error] QuerySet.cpp(20): E2136 Constructor cannot have a return type specification

Add the semicolon to the end of the class declaration and all these problems go away.

Friday, May 25, 2007

Database Objects

TTable
TQuery
TStoredProc - store procedure are available in ACCESS since 2000. However, you cannot get to them from the user interface. They must be created.

Tuesday, May 15, 2007

Parameters

A subroutine's parameters can be passed on one of two ways.

  • call by value - copies the value of an argument in to the formal parameter of the subroutine. Changes to the parameter of the subroutine has no effect on the argument used to call it.
  • call by reference - the address of an argument is copied in the parameter. Changes made to the parameter will affect the argument.