Subversion Repositories DevTools

Rev

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

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

=pod

=for htmltoc    FAQ::Windows CSharp::Creating Interop DLLs

=head1 NAME

How to create C# Interop DLLs

=head1 SYNOPSIS

In your build.pl file use either LinkPkgArchive or BuildPkgArchive to include
the package containing the DLL to import. LinkPkgArchive is preferred.

In your makefile.pl ...

    # Create Interop DLL
    #..
    Src ('*', 'lib.win32/COM_LIBRARY_NAME.dll', '--FromPackage' );

    GenerateFiles ('*', 'TlbImp', '/nologo',
                   '--Prerequisite(COM_LIBRARY_NAME.dll)',
                   '/out:--Generated(Interop.COM_LIBRARY_NAME.dll)',
                   '/namespace:COM_LIBRARY_NAME' );

    # Install - for local use only
    InstallLib ('*', 'Interop.COM_LIBRARY_NAME.dll' );

    # Package for all to use
    PackageLib ('*', 'Interop.COM_LIBRARY_NAME.dll' );

=head2 Points of Interest

=over 4

=item *

The DLL can be sourced from an package, or locally. The example shows the DLL
being sourced from a package.

=item *

The TlbImp utility is a part of the SDK - and is available to JATS.

=item *

If the DLL is to be used within the same project, then it need to be installed
with the InstallLib directive.

=item *

The same library is built for both Debug and Production.

=back