开发者

Why won't my DLL register with RegSvr32?

开发者 https://www.devze.com 2023-01-07 18:48 出处:网络
I have to register a .dll file named MatchMolDLL.dll. To register the DLL I followed these steps: 1) Goto开发者_运维问答 RUN

I have to register a .dll file named MatchMolDLL.dll.

To register the DLL I followed these steps:

1) Goto开发者_运维问答 RUN

2) Type “cmd”

3) Type “regsvr32 MatchMolDLL.dll”

However regsvr32.exe reports:

"MatchMolDLL.dll was loaded, but the DllRegisterServer entry point was not found."

How can I register it?

If I had to link this .dll file with another executable can it be done?


MatchMoIDLL.dll isn't a COM DLL and you can't use regsvr32.exe to register it. It's a plain old Win32 DLL.

You can find out more about it here:

http://merian.pch.univie.ac.at/~nhaider/cheminf/cmmm.html#dll


It is not a COM server. You have to use P/Invoke to use this DLL. The instructions are available in the source code file, it gives the VB6 declarations:

Private Declare Sub mm_SetMol Lib "matchmolDLL.dll" (ByVal st As String)
Private Declare Sub mm_SetCurrentMolAsQuery Lib "matchmolDLL.dll" ()
Private Declare Function mm_Match Lib "matchmolDLL.dll" (ByVal Exact As Boolean) As Long

Private Declare Function mm_GetRings Lib "matchmolDLL.dll" () As Long
Private Declare Function mm_GetAtomRing Lib "matchmolDLL.dll" (ByVal AtomNumber As Long) As Long
Private Declare Sub mm_Version Lib "matchmolDLL.dll" (ByVal st As String)

Which you'll have to translate to the corresponding VB.NET or C# [DllImport] declaration. Use "int" instead of Long in those declarations. For example:

[DllImport("matchmolDLL.dll", CharSet = CharSet.Ansi)]
private static extern void mm_SetMol(string st);

Etcetera.

0

精彩评论

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