Compiler Options

team lib

There are four linker options that can be used to control the output of IDL and type library files for an attributed COM project. They are listed in Table 6-7 and explained in the following subsections.

Table 6-7: Linker Options Used with Attributed Code

Option

Description

/idlout

Specifies the name of an IDL file in which the compiler will save the IDL generated for the project

/ignoreidl

Specifies that IDL attributes present in the source should not be used to create an IDL file

/midl

Used to specify the name of a file containing MIDL command-line options

/tlbout

Specifies the name of the type library created by the compiler

Generating IDL

The /idlout and /tlbout options can be used to specify the base names for IDL and type library files. If you dont use either of these options, the linker will use vc70 as the base name for the generated files, creating vc70.idl, vc70.tlb, and so on.

If you just specify /idlout and /tlbout , all the MIDL-generated files (*.tlb, *.idl, *_i.c, *_p.c, and *.h) will take their names from the filename you supply. You can specify both options to generate a type library with a different name to the IDL file. In this case, the IDL file name is used to name all the generated files except the type library.

You use the options on the command line like this:

 cl/LDMyServer.cpp/link/tlbout:foo.tlb 

Since /tlbout is a linker option, you need to place it after the /link option.

Suppressing IDL Generation

By default, IDL attributes in source code will be processed and used to create an IDL file, which is then processed by MIDL in the usual way. If you want to suppress the generation of an IDL file for some reason, use the /ignoreidl linker option.

 
team lib


COM Programming with Microsoft .NET
COM Programming with Microsoft .NET
ISBN: 0735618755
EAN: 2147483647
Year: 2006
Pages: 140

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net