|
Virtual Function Tables
A virtual function table is an array of pointers to the methods an object
supports. If you're using C, an object appears as a structure whose first member is
a pointer to the virtual function table (lpVtbl); that is, the first member points to an array containing function pointers.
The methods all take a pointer to the function table as the first parameter.
Thus, the following example calls the Read method of a pStream object:
pStream->lpVtbl->Read(pStream, parameters)
In C+ +, the pointer to the virtual function table, the this pointer, is implicit. The following is equivalent to the previous example
when using C+ +:
pStream->Read(parameters)
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps
Win32 Programmer's Reference (win32.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|