开发者

COM OCX registration - 2 DLL's with same name

I have a native app that has an .OCX file that needs to be registered for it to be used in a .NET application.

Now currently there's different versions of this .OCX on the开发者_高级运维 machine. Can someone please explain how this can affect the registration of this new (updated) .OCX file registration?

And how does my .NET app know which object to create from which .OCX file?


COM servers are required to change their CLSID guids if their interfaces are no longer compatible. So if your supplier did it right, you should be able to register both of them and get the right one when you use the right reference in your project.

Like any rule, this one got violated often and is presumably the reason you started this question in the first place. The back-up plan is to use registry-free COM, you write a manifest and add it to your program so it always uses the local copy of the COM server DLL instead of the one that was registered. Find out how to do this by googling "regfree COM", I see many relevant and useful hits at the top.


I believe COM class registrations include the entire path to the "server" providing the COM component. If the two versions of the .OCX have different class GUIDs, then there should be no issues.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜