Subversion Repositories DevTools

Rev

Rev 1269 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#-------------------------------------------------------------------------------
#   Documentation
#

=pod

=for htmltoc    FAQ::Windows::Use Of Windows IDL Files

=head1 NAME

How to create and use Windows IDL Files

=head1 SYNOPSIS

The following fragemnt uses The Microsoft midl compiler to process .IDL files.
The results are then inluded in a DLL.

    #
    # Build platform definitions ..
    #
    Platform( '*' );


    ############################################################################

    #   Create a resource file
    #
    GenerateFiles   ( '*',  "--Tool=gen_winrc.pl",
                            "-out --GeneratedCommon(MyComponent.rc2)",
                            "-version=$ScmBuildVersion",
                            "-comment='MyComponent'",
                            "-name=$ScmBuildPackage",
                            "-description=''",
                            "--NoWarn");

    #   Process IDL files
    #
    GenerateFiles ( '*',    "--Tool=midl",
                            "/tlb --GeneratedCommon(MyComponent.tlb)",
                            "/h   --GeneratedCommon(MyComponent.h)",
                            "/iid --GeneratedCommon(MyComponent_i.c)",
                            "/Oicf",
                            "--Prerequisite(MyComponent.idl)",
                            "--CreatedCommon=MyComponent_p.c",          # Generated, but excluded
                            "--CreatedCommon=dlldata.c"                 # Generated, but excluded
                            );

    ############################################################################
    #   Define the source files
    #

    Src       ( '*',  Your Files here );

    SharedLib('*'   , "MyComponent"
                    , @OBJS,
                    , '--Exclude(MyComponent_i,MyComponent_p,dlldata)',
                    , '-lOtherLibraries'
                    , "--Def=MyComponent.def",
                    , "--Resource=MyComponent.rc,MyComponent.rc2,MyComponent.tlb"
                    );

=head2 Points of interest

=over 4

=item *

The DLL version number is also generated

=item *

Several files are created by the idl compiler, but they are not used. They need
to be excluded from the list of object files used to create the DLL. This is
done with the "--Exclude" option.

=item *

The IDL compiler creates a .tlb file. This is a resource file and should be
added to the list of resource files combined into the DLL.    

=back