Chapter 15 errata

p621-print, p927-pdf and p623-print, p929-pdf

Figure 15.1 and 15.2 are swapped.


p646-print, p952-pdf

Some information in the fifth paragraph (first paragraph of the section headed Using C++Builder DLLs with Microsoft Visual C++) is incorrect. It states:

... You may think that this is going to be a difficult task or that you're going to have to run a special utility against the DLL to make it work with Visual C++, such as you had to do to get the Visual C++ DLL to work with C++Builder. You are wrong. ...

ALL of this portion of the paragraph should be removed.


p651-print, 957-pdf

In the second paragraph the reference to Listing 15.9 is incorrect. It should be referring to the first code snippet on this page which does not have a listing number. Change the sentence from:

Listing 15.9 contains only the header for the GenericShape class, so now it's time to add the method that will get the shape name.

to:

Now it's time to add the method that will get the shape name.


p651-print, 957-pdf

Another incorrect / confusing reference to Listing 15.9 appears on the last line of the page. The following sentence confuses the reader by making them think that listing 15.9 is related to the previous text. It is not.

See Listing 15.9.

Change this to:

Listing 15.9 shows how the shape plugin can be called from an application via the GenericShape class to return the name of the shape.


p652-print, p958-pdf

Listing 15.9 contains a programming error that prevents it from working at all. Change the listing to:

char* GenericShape::GetShapeName()
{
    typedef char* (__stdcall *SHAPENAMEADDR)();
    HISTANCE plugin;
    SHAPENAMEADDR shapeNameFunc;
    plugin = ::LoadLibrary("ShapePlugin.dll");
    if (plugin)
    {
        char* tempName = (char*)NULL;
        shapeNameFunc = (SHAPENAMEADDR)GetProcAddress(plugin, "GetShapeName");
        if (shapeNameFunc)
            tempName =shapeNameFunc();
        FreeLibrary(plugin);
        return tempName;
    }
    ShowMessage("Error! Couldn't load library");
    return 0;
}

p654-print, p960-pdf

Insert a single line in Listing 15.11 with an opening brace '{' as follows:

class TIExpert : public TInterface
{
public:

p655-print, 961-pdf

Replace the following line in Listing 15.12:

virtual void __stdcall DoneExpert(void) = 0;
With this:
virtual void __stdcall DonePlugin(void) = 0;

p656-print, 962-pdf

Remove the following line from Listing 15.13:

virtual TBCB5PluginType __stdcall GetPluginType(void);

CD-ROM

The following file is not necessary:

\source\Chapter15\TBCB5PluginComponents\IBCB5PluginBase.cpp