c#com interop dll/vb6项目-事件不会触发 [英] c# com interop dll/ vb6 project - event doesn't fire

查看:80
本文介绍了c#com interop dll/vb6项目-事件不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想将c#-dlls实现到vb6-project中.只要将dll编译到那里并通过Project Options注册进行COM互操作,一切就可以在两个开发人员的计算机上正常工作.
当完成的exe传输到另一台PC上并且使用regasm在其中注册了dll时,它仍然有效-除了从其中一个dll触发的事件之外,它们永远不会发生.
(在dll也在那里编译之前,也适用于第二个开发人员的计算机)
看一下注册表,结果发现事件已注册并链接到开发人员的计算机,而不是目标PC,尽管它出现在tlb.似乎注册表中仅缺少事件,类在那里.

我做错了什么或缺少了什么?
我什至不知道这可能是问题的根源,尝试了所有我能想到的内容并用Google搜索了几个小时.(例如,强名称是没有选择的,因为项目中的其他第二个源dll不会具有强名称-无法使用键来编译项目)
我真的很感谢任何提示...

解决方案

我想这是一个遗留项目?我不知道使用了什么注册表项(我从未使用过VB6,也从未使用过),但是,如果您只需要一个注册表项,是否可以在应用程序中添加该注册表项并使其正常工作? /blockquote>

谢谢您的猜测:)-看起来是vb6特有的,目的计算机要理解它必须根据完整的设置进行传输的exe,Visual Studio vb6为此提供了工具.现在它可以在目标计算机上运行了.

我还不确定其他开发人员是否可以将dll用于其他项目而无需在其计算机上进行编译,我会更新...

对于其他开发人员:向regasm注册,即使程序集不能被强命名也使用/codebase,并且暂时可以正常工作


Hi there,

I want to implement c#-dlls into a vb6-project. Everything works fine at both developers'' computers as long as the dlls are compiled there and registered for COM interop via Project Options.
When the finished exe is transferred to another PC and the dlls are there registered using regasm it still works - except for events fired from one of the dlls, they never occur.
(True also for the second developer''s computer before the dll was compiled there too)
Having a look at the registry it turns out the event is registered and linked there at the developers'' computers but not at the target pc though it appears at the tlb. Seems only the event is missing in the registry, classes are there.

What do I do wrong or what is missing?
I''m not even sure if this is where the problem might come from, tried out everything I could think of and googled for hours.. (eg. strong name is no option as other 2nd source dlls in the project don''t have strong names - the project can''t be compiled using a key)
I''d really appreciate any hint...

解决方案

I guess this is a legacy project ? I have no idea what registry keys are used ( I''ve never used VB6 and never will ), but, if a registry key is all you need, can you just add that key in your app and make it work that way ?


Thank you for the guess :) - looks like it''s something vb6-specific, for the target computer to understand the exe it has to be transferred per a complete setup, visual studio for vb6 supplies tools for that. now it works at the target computer.

i''m not sure yet if other developers can use the dll for other projects without compiling it at their computer, i''ll update...

for other developers: registered with regasm, useed /codebase even if assembly can''t be strong named and it works for the moment


这篇关于c#com interop dll/vb6项目-事件不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆