如何检查是否一个DLL文件注册? [英] How to check if a DLL file is registered?

查看:1143
本文介绍了如何检查是否一个DLL文件注册?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要如何找到在C#编写一个DLL文件是否被注册或不编程?

How do I find whether a DLL file written in C# is registered or not programmatically?

我已经尝试过这个code,但它不会脱落。

I already tried this code, but it doesn't come off.

如果我注册一个DLL文件,并检查使用此code返回。如果我注销它并运行此同一块code,它再次返回true。我给的DLL文件作为参数的完整路径。

If I register a DLL file and check using this code it returns. If I unregister it and run this same piece of code, it returns true again. I'm giving the fullpath of the DLL file as argument.

我们开发了的Visual C ++ 一个简单的DLL文件。之后,我们把它注册。现在,我们要确认wheteher已注册。

We developed a simple DLL file in Visual C++. After that we registered it. Now we want to confirm wheteher it is registered.

鲍勃,你将取代片code对自己的,它仍然是我很难?

Bob, will you replace the piece of code on your own, it is still difficult for me?

如果我注册一个DLL文件,是否有一个条目present在注册表中?我会找到这些条目和判断wheteher的DLL文件注册与否?

If I register a DLL file, is there an entry present in the registry? Shall I find those entries and judge wheteher the DLL file is registered or not?

最后的答案正在与一些修改。我看着在类型库,而不是CLSID。

The last answer is working with some modifications. I looked in typelib instead of clsid.

埃里克明镜: 反正,我有一个轻微的修改做了。它的工作了。

earwicker der: Anyway, I have done it with a slight modification. It's working now.

推荐答案

您需要找到在DLL中定义一个COM对象了GUID。然后看看这个注册表项:

You need to find out the GUID of a COM object defined in the DLL. Then look at this registry key:

HKEY_CLASSES_ROOT\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\InprocServer32

装X的使用GUID。

Replace the x's with the GUID.

有应该具有包含的完整路径DLL中的默认值。

It should have a default value that contains the full path to the DLL.

这篇关于如何检查是否一个DLL文件注册?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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