How to add unmanaged dll to show up in Add Referen

2019-08-19 19:03发布

I am currently trying to use pHash.dll on http://phash.org

Unfortunately it was written in C++, I'd have to use DLLImport

But the problem I am having is how to register pHash.dll (compiled thru VS2010/C++)
I've tried to register using regsrv32 and have been fruitless giving an error message.

enter image description here

Now, How can i register pHash to show up in COM tab?enter image description here

1条回答
Lonely孤独者°
2楼-- · 2019-08-19 19:14

The DLL in question exports flat APIs. The Add COM References Tab is for DLLs that expose COM objects. Instead of using Add Reference to refer to the DLL, you need to write a pinvoke declaration to let .NET know about your flat API.

Here's a helpful article:

http://msdn.microsoft.com/en-us/magazine/cc164123.aspx

Martyn

查看更多
登录 后发表回答