开发者

VS 2005 can't find .NET DLL class definitions even after Regasm

开发者 https://www.devze.com 2022-12-23 16:11 出处:网络
I have an unmanaged C++ project that uses a third-party .NET dll. It builds fine on one machine, but not on another--the IDE can\'t find the class definitions.

I have an unmanaged C++ project that uses a third-party .NET dll. It builds fine on one machine, but not on another--the IDE can't find the class definitions.

I ran RegAsm.exe TheLib.dll /codebase /tlb:TheLib.tlb, and the registry entries on the two machines match. That is, even though the IDE says that TheLib.Function() is undefined, it's there in the registry on both machines.

What could I be doing wrong? (The source on the two machines is checked out of the same repository, and there are 开发者_如何学JAVAno uncommitted or unversioned files.)


This can sometimes happen if you don't properly export classes or functions from your library. Even though the code is there and it compiles fine when it links it may omit definitions or not actually generate exports to functions. So then other projects importing the lib show them as being undefined.

This article describes a good way to export classes from a DLL and is worth a read as it could be related to your problem.

0

精彩评论

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

关注公众号