开发者

Committing a TLB file to repository

开发者 https://www.devze.com 2023-03-21 06:05 出处:网络
I\'m importing a TLB file into my project since I\'m using a COM DLL. A TLB file is a binary file, which I need to compile my source code and so I was wondering 开发者_如何学Pythonif it\'s good progra

I'm importing a TLB file into my project since I'm using a COM DLL. A TLB file is a binary file, which I need to compile my source code and so I was wondering 开发者_如何学Pythonif it's good programming practice to commit it to the repository.


Yes, it's ok to put binary files in a source repository. The rule sometimes called 'do not put binary files in a source repository' should better be called 'do not put temporary files or files that are a compilation result in a source repository'. Basically anything that can't be produced from other files and is relevant for the project itself (i.e. no editor preference files) can be put in a repository.


A type library is normally created by midl.exe from an interface definition language (IDL) source file. Or from a utility like Tlbexp.exe or Regasm.exe which can generate a type library from a .NET assembly. If you don't have the source for the type library then there's little else you can do but check-in the .tlb. Note that a type library is very commonly embedded as a resource in the COM server. So checking in the binaries is an option too.

Note that it is technically possible to reverse engineer the IDL from the type library with the Oleview.exe File + View Typelib command. Not so sure that's useful when you don't actually control the source.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号