Not
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
You can package a type library as a separate file or embed it as Win32 resource file within a .NET-based application. Microsoft Visual Basic 6.0 performed this task for you automatically; however, when using Microsoft Visual Basic 2005, you must embed your type library manually.
To embed a type library as a Win32 resource in a .NET-based application
Compile your managed application as a library file. For example, to create an assembly for an application called
MyApp, type the following command at the command prompt:vbc /t:library MyApp.vbcsc /t:library MyApp.csExport a type library file from your assembly using the Type Library Exporter (Tlbexp.exe). At the command prompt, type the following command:
tlbexp MyApp.dll /out:mytypelib.tlbCreate a resource script that contains the following statement:
IDR_TYPELIB1 typelib "mytypelib.tlb"For this example, the script file name is
myresource.rc.Compile the script using the Microsoft Windows Resource Compiler (Rc.exe). At the command prompt, type the following command:
rc myresource.rcRc.exe produces the
myresource.resresource file.Compile the source file again and specify the resource file. At the command prompt, type the following command:
vbc /t:library MyApp.vb /win32res:myresource.rescsc /t:library MyApp.cs /win32res:myresource.res
See Also
Concepts
Packaging an Assembly for COM
Exposing .NET Framework Components to COM