Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
1269 dpurdie 1
#-------------------------------------------------------------------------------
2
#   Documentation
3
#
4
 
5
=pod
6
 
7
=for htmltoc    FAQ::Windows::Use Of Windows IDL Files
8
 
9
=head1 NAME
10
 
11
How to create and use Windows IDL Files
12
 
13
=head1 SYNOPSIS
14
 
15
The following fragemnt uses The Microsoft midl compiler to process .IDL files.
16
The results are then inluded in a DLL.
17
 
18
    #
19
    # Build platform definitions ..
20
    #
21
    Platform( '*' );
22
 
23
 
24
    ############################################################################
25
 
26
    #   Create a resource file
27
    #
28
    GenerateFiles   ( '*',  "--Tool=gen_winrc.pl",
29
                            "-out --GeneratedCommon(MyComponent.rc2)",
30
                            "-version=$ScmBuildVersion",
31
                            "-comment='MyComponent'",
32
                            "-name=$ScmBuildPackage",
33
                            "-description=''",
34
                            "--NoWarn");
35
 
36
    #   Process IDL files
37
    #
38
    GenerateFiles ( '*',    "--Tool=midl",
39
                            "/tlb --GeneratedCommon(MyComponent.tlb)",
40
                            "/h   --GeneratedCommon(MyComponent.h)",
41
                            "/iid --GeneratedCommon(MyComponent_i.c)",
42
                            "/Oicf",
43
                            "--Prerequisite(MyComponent.idl)",
44
                            "--CreatedCommon=MyComponent_p.c",          # Generated, but excluded
45
                            "--CreatedCommon=dlldata.c"                 # Generated, but excluded
46
                            );
47
 
48
    ############################################################################
49
    #   Define the source files
50
    #
51
 
52
    Src       ( '*',  Your Files here );
53
 
54
    SharedLib('*'   , "MyComponent"
55
                    , @OBJS,
56
                    , '--Exclude(MyComponent_i,MyComponent_p,dlldata)',
57
                    , '-lOtherLibraries'
58
                    , "--Def=MyComponent.def",
59
                    , "--Resource=MyComponent.rc,MyComponent.rc2,MyComponent.tlb"
60
                    );
61
 
62
=head2 Points of interest
63
 
64
=over 4
65
 
66
=item *
67
 
68
The DLL version number is also generated
69
 
70
=item *
71
 
72
Several files are created by the idl compiler, but they are not used. They need
73
to be excluded from the list of object files used to create the DLL. This is
74
done with the "--Exclude" option.
75
 
76
=item *
77
 
78
The IDL compiler creates a .tlb file. This is a resource file and should be
79
added to the list of resource files combined into the DLL.    
80
 
81
=back