How to add unmanaged dll to show up in Add Reference's COM tab

落花浮王杯 提交于 2020-01-16 14:47:22

问题


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.



Now, How can i register pHash to show up in COM tab?


回答1:


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



来源:https://stackoverflow.com/questions/6233343/how-to-add-unmanaged-dll-to-show-up-in-add-references-com-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!