-= VCL RAD DirectX for C++ Builder =-

Welcome to BCB-Tools.com Latest News

Development Tools Demo Applications Step-By-Step Tutorials Component Reference

Register our Tools Available Downloads

Frequently Asked Questions Links to other sites Information about the BCB-Tools.com website










    THE BCB_CODE_GENERATOR V2.3
    Go to the Welcome Page
        THE BCB_CODE_GENERATOR

    This page will ultimately describe the BCB_Code_Generator in detail...
    Without this application, there would not be a TDx_Library.

    For now, it is limited to a lot of v1.4 screenshots and brief descriptions.
    The current version is v2.3, compatible with BCB 1,3,4,5,6 and Dx7 and Dx9 and a little BDS 2006.


    THE 'OTHER' CODER OF THE TDX_LIBRARY - THE BCB_CODE_GENERATOR



    The BCB_Code_Generator is a tool that Darren John Dwyer developed that allows us to create and maintain the TDx_Library.

    It's a serious Borland C++ Builder source code generator that actually creates the vast majority of the TDx_Library,
    all by itself, without any human intervention.

    It contains massive amounts of information, databases for most of the DirectX 7.0a SDK and DirectX 9.0c SDK, and it's very BIG.

    eg: Where there is a particular type of translation, we code it once, test it, it works for the entire Win32 SDK.



    In a nutshell, what does it do?

    "any type of SDK, C or C++, can be translated into RAD C++ Builder visual component libraries
    - automagically - using the BCB_Code_Generator."

    • If you've got a Win32 or any other standard C or C++ structure definition, and you want it to be a standardised C++ Builder VCL class complete with properties, events, and automated error checking, the BCB_Code_Generator will help you do it easily and automatically.
    • If you've got a Win32 COM interface or any other similar C or C++ class or interface, and you want it to be a standardised C++ Builder VCL class complete with properties, methods, events, callbacks, and automated error checking, the BCB_Code_Generator will help you do it easily and automatically.
    • If you want to have lots of these C++ Builder VCL Components automatically working together as a C++ Builder Component Library, it's done, the BCB_Code_Generator will help you do it easily and automatically.
    • If you want detailed source code documentation, and dynamic source code properly formatted, automatically, the BCB_Code_Generator does it.
    • If you want detailed help and html, that's automatically done for you too.
    • If you want the process of going from raw structure definitions and function definitions to fully working, full documented Borland C++ Builder VCL Components, standardized just nicely, it's done.
    • Add your own custom properties, custom methods, custom events, all integrating with auto code perfectly.
    • And translating the raw data into 100% compilable VCL source code? Automated too.
    • Relax, it's all on auto-pilot, of course.



    Example:

    Here's a standard DirectX structure definition, copied and pasted from the DirectX SDK...

    The DDDEVICEIDENTIFIER2 structure is defined as :-

    struct DDDEVICEIDENTIFIER2 {
    char szDriver[MAX_DDDEVICEID_STRING];
    char szDescription[MAX_DDDEVICEID_STRING];
    LARGE_INTEGER liDriverVersion;
    DWORD dwVendorId;
    DWORD dwDeviceId;
    DWORD dwSubSysId;
    DWORD dwRevision;
    GUID guidDeviceIdentifier;
    DWORD dwWHQLLevel;
    };

    Using the BCB_Code_Generator, and after setting this structure definition up as a "Wrapper" or "MultiWrapper" component,
    this automagically becomes a complete, fully documented, next-generation Borland C++ Builder Visual Component Library
    component, complete with fully documented source code, project files, readme files, help files, html reference files,
    the lot...

    Here's what the generator turns this simple structure definition into :-

    TDDDeviceIdentifier.htm, etc... Start of Online HTML Reference
    TDDDeviceIdentifier.H... Source Code Header File
    TDDDeviceIdentifier.CPP... Source Code File
    TDDDeviceIdentifier, etc... in the TDx_Draw_Library Help File

    Plus there are multiple inclusions in the relevant project and help files and glossary files, and so on...



    Example:

    Here's a standard DirectX interface definition, copied and pasted from the DirectX SDK...

    The IDirectDrawSurface7 interface is defined as :-

    LPDIRECTDRAWSURFACE7

    Plus relevant standard C/C++ function definitions... eg: IDirectDrawSurface7::Blt()
    // Original Function Definition
    HRESULT Blt(
    LPRECT lpDestRect,
    LPDIRECTDRAWSURFACE7 lpDDSrcSurface,
    LPRECT lpSrcRect,
    DWORD dwFlags,
    LPDDBLTFX lpDDBltFx
    );


    Using the BCB_Code_Generator, and after setting this object up as an "Interface" component,
    this automagically becomes a complete, fully documented, next-generation Borland C++ Builder Visual Component Library
    component, complete with fully documented source code, project files, readme files, help files, html reference files,
    properties, methods, events, callbacks, the lot...

    Here's what the generator turns this simple interface definition into :-

    TDx_DrawSurface.htm, etc... Online HTML Reference
    TDx_DrawSurface.H... Source Code Header File
    TDx_DrawSurface.CPP... Source Code File
    TDx_DrawSurface, etc... in the TDx_Draw_Library Help File

    Plus there are multiple inclusions in the relevant project and help files and glossary files, and so on...



    This program now creates between 95%++ of the TDx_Library source code,
    100% of supporting project files, 100% of the help, and 95% of the html reference.

    The other minor code bits which are not yet generatable have been manually coded by darren and
    inserted into the generator's database manually.



    For those of you who know about Delphi's Project JEDI,
    the BCB_Code_Generator does a very similar job, except you add a minimal amount of data, the generator organizes
    the data and creates the vast majority of the source code, prompts for user intervention when required,
    and turns the resulting databases into megabytes of working source code.



    It's very smart, but mostly it's just a gruntworker.

    Given minimal data elements such as standard C++ structure definitions, and standard
    C++ function definitions for a COM interface, with vcl-style descriptions, it creates literally everything else...

    from the point of having only simple definitions, no actual code or directory structure,
    to having 100% programmed BCB component libraries ready to install
    - and all in a few minutes per generation.



    The best bit of all is that the generator creates and maintains the massive amounts of
    cross-linked information within the entire TDx_Library, such as the see-also's throughout
    the website reference.



    The TDx_Library is the first real-world test of the BCB_Code_Generator technology,
    which works incredibly well already (the TDx_Library is proof).

    Ideally it is designed to translate all available Windows COM interfaces into standard
    VCL style Borland C++ Builder component libraries, complete with everything offered in
    the TDx_Library.

    It can be used by any BCB programmer who wishes to create and maintain custom BCB tools.
    In future, it will support the same functionality for Delphi programmers.



    All it takes is the raw data entry into the BCB_Code_Generator, a few double-click's to link the data, and you are ready to begin generating.
    • Generation is where the generator auto-assembles all pre-generated data into working source code for BCB Component Libraries
    • Pre-Generation (pregen) is where the generator auto-creates database records, code, descriptions, settings, etc. as required to convert from Win32 style code to working VCL style code.
    • There are 4 distinct generation phases :-
      • Phase 1 - the generator scans the raw data and create new database records and code as required.
        - This phase mostly requires answering "Yes / No" as required, and occasionally modifying code when prompted.
      • Phase 2 - pre-gen once again - the generator fixes the cross-referencing of the database, re-codes where necessary using code created during Phase1.
        - This phase usually runs by itself, but may still require some "Yes / No" or occasional code modifications.
      • Phase 3 - repeat until pre-generation stops.
        - Add any manual descritions, properties, methods, events, callbacks, etc. to database where required.
      • Phase 4 - generate finished BCB component library source code.
        - Compile generated source code, should be okay normally, go back to Phase3 as required.


    Once it fully compiles and works, generate source code, help files, html files and 'viola',
    working RAD component libraries for BCB.

    Customize our auto-installer and you have a complete RAD component library construction kit...



    Here's how it works :-
    • You create a new component (object)
    • You decide if it's a "wrapper" component, a "multi-wrapper" component, or an "interface" component


    • If it's a wrapper or a multi-wrapper component, you add the structure definition, then pre-generate the object
      The generator will parse the structure definition and auto create corresponding __property's in the database
      Inspect all properties, verify their links and modify settings and descriptions where necessary
      Setup the properties to be custom/auto, read/write, read-only, write-only, __published: public: protected: private:
      Add bitwise flags definitions for properties where necessary
      Pre-Generate all properties to auto-create relevent translation code and definitions for the property
      Pre-Generate the object again to update it's global properties and methods, such as ::Clear()
      Ready for code generation.


    • If it's an interface component, you add the COM interface type, eg. LPDIRECTDRAW7
      Create a new method, paste the relevant COM function definition into it's field, and pre-generate the method
      The generator will parse the function, auto translate all parameters and insert them into the database
      Inspect all method parameters, verify links and modify settings where necessary
      Setup method parameters to "must be" and "cannot be [value]", and methods as public: protected: private:
      Add bitwise flags definitions for method parameters where necessary
      Pre-Generate the method to auto-create relevant translation code and definitions for the method
      Ready for code generation.


    • Then,
      Add OnXXX() events and OnYYY() callback events
      Add manual code additions, such as custom value-add methods and properties
      You create icons for your components.


    • Generate everything, compile, install into BCB component palettes, test, fix, re-import code into the generator
      Repeat until you have working components


    • Generate a complete working RAD component library for Borland C++ Builder, complete with source code, project files, and F1 instant help.




    For more up-to-date information regarding the BCB_Code_Generator, visit this page occasionally.
    And the following screenshots are from an older version but show what is required.


    Darren Dwyer,
    BCB-Tools.com.





    PROJECTS FORM

    The Project + SubProject Form showing a SubProject being selected:



    Extra CPP Settings:



    Extra HTML Settings:






    GLOBAL BITS

    The Glossary Editor:



    The Examples Editor:



    Global Search and Replace:





    THE CODE GENERATION FORM

    TDx_Draw_Library:



    Database Pre-Generation:



    BCB Code Generation:



    Help File Generation:



    HTML Generation:






    GENERATING CODE

    Nothing:



    Generate Code:



    It's Generating:



    Done:



    The TDx_Draw_Library:






    DATABASE MANIPULATION

    Object Editor:





    See-Also's:



    Structure Definitions:



    Auto translate Structure Members to Property's:



    Methods:



    Events:



    Callbacks:





    Xtra Code:





    Auto Constructor:



    Auto Destructor:



    Manual Create:



    Manual Destroy:





    Property Editor:





    Property See-Also's:



    Property to Structure Member Links:



    Property Flags:



    Property Definition:



    Property FGet() Code (100% COMPUTER-GENERATED):



    Property FSet() Code (100% COMPUTER-GENERATED):



    Property Flags Editor:





    Methods Editor:





    Original Method Definition + Auto-Definition:



    Method Parameter Translations:



    Method Code (100% COMPUTER-GENERATED):



    Method Options:





    Method Parameter Editor:





    Method Param Settings:



    Method Param #Includes:



    Method Param Linking:



    Method Parameter Flags:



    Method Param Flags Editor:





    Event's Editor:





    Callback's Editor:





    As you can see, a lot of effort has been put into the TDx_Library.

    The BCB_Code_Generator is a bit clunky, but works incredibly well.
    The BCB_Code_Generator makes the entire TDx_Library possible.
    The BCB_Code_Generator databases cover pretty well everything in the DirectX 7.0a SDK.

    Final Proof:

    This is how BIG the BCB_Code_Generator is :-



    Directory Listing:













    FUTURE LIBRARY DATABASES

    TDx_Play_Library:



    TDx_Setup_Library:



    TDx_3DI_Library:



    TDx_3DR_Library:



    TDx_3DX_Library:



    TDx_Music_Library:





    It's BIG...
    Want more DirectX & Win32 SDK Wrappers using the same techniques?
    Help us by registering our existing BCB Tools.

    Register a copy of the TDx_Library

    Want to get your hands on a copy of the BCB_Code_Generator?
    Send us an email and ask us about it...



























Top

Welcome |  Latest News |  Tools |  Demos |  Tutorials |  Reference |  Register |  Downloads
FAQ |  Links |  Site Information

This page is Copyright © 2000-2007++ Darren John Dwyer, Australia. All Rights Reserved.
Borland C++ Builder, CBuilder, etc are Trademarks of Borland Corporation.
DirectX, DirectDraw, Windows, etc are Trademarks of Microsoft Corporation.