开发者

ATL: Can't remove a method from a COM interface - ALWAYS reappears like magic

开发者 https://www.devze.com 2023-02-16 02:29 出处:网络
Environment:VS2008, C++ ATL COM, 64Bit, Windows 7 I\'m trying to remove a method from an older COM interface.I modify the *.idl, modify the associated *.h and *.cpp implementation files and also remo

Environment: VS2008, C++ ATL COM, 64Bit, Windows 7

I'm trying to remove a method from an older COM interface. I modify the *.idl, modify the associated *.h and *.cpp implementation files and also remove it from the main project's .h file. I can search the whole project for the old method name - does not show and it compiles/links fine. However, if I then use the Object Browser to look at the compiled DLL 开发者_如何转开发- the dang method is still there! If I 'reference' the DLL in a .NET project - shows the method. If the .NET code attempts to use the method - it gets a memory exception (which makes sense). I can't for the life of me figure out how to modify the IDL, remove the method code and have the resulting compiled DLL be correct.

Where the heck is the method lurking and is there a different way to remove a method from an existing ATL generated COM interface? I'm stumped! Thanks!


Did you unregister the old DLL module and registered the new one? Sounds like your registry may have an inconsistent entry.

Also make sure there are no pre-compiled headers etc laying around so that when you compiler you are sure it hasn't included some old copy.

probably best is to delete the complete build directory (debug/release) before compiling just in case you missed deleting some old files.

check also the path where the .dll is loaded, you can see that in the object browser, compare that with the registry entry. maybe you did a 32bit version before?

0

精彩评论

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

关注公众号