NETLink`
NETLink`
LoadCOMTypeLibrary
LoadCOMTypeLibrary[library]
creates a so-called "interop" assembly from the named type library and loads that assembly.
更多信息和选项
- To use LoadCOMTypeLibrary, you first need to load .NET/Link using Needs["NETLink`"].
- The following options can be given:
-
SaveAssemblyAs None a full pathname to the assembly file you want SafeArrayAsArray False whether to marshal SAFEARRAY types as System.Array - Once a type library has been loaded in this way, all its types will have managed equivalents created for them, so you can program with these types as if they were native .NET types.
- LoadCOMTypeLibrary is the programmatic equivalent of running the tlbimp.exe tool that is part of the .NET Framework SDK.
- The assembly can optionally be saved to disk (using the SaveAssemblyAs option) so that you do not have to call LoadCOMTypeLibrary in the future.
- If you plan to do more in-depth work with COM objects described in a given type library, it is recommended that you use LoadCOMTypeLibrary or the tlbimp.exe tool to create an interop assembly and then use that assembly.