WIN32 and CLR

 

 

問題:

A reference to the "....dll" could not be added.Please make sure that the file is accessible and that it is a valid assembly or COM component

 

Normally, if it is a .NET dll, we can use Add reference to import it to the project. But if not, we have 2 approaches to do that, one is by add reference which will generate an interop dll to convert COM component to .Net component, and the other is by PInvoke to call the methods inside that dll. For uEye_tools.dll, I think you could try to use P/Invoke first, if you still could not work it out after trying, then I would recommend you to contact the third party side for more efficient responses. In addition, you are not able to use regsvr32 to register that dll since it is only adapted for COM components.

For more information about P/Invoke, please kindly refer to these links.

What is Platform Invoke Service
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/ea96d60f-c468-493c-b145-39af98aa6ddc

Using P/Invoke to Call Unmanaged APIs from Your Managed Classes
http://www.microsoft.com/indonesia/msdn/pinvoke.aspx

Calling Win32 DLLs in c# with P/Invoke
http://msdn.microsoft.com/en-us/magazine/cc164123.aspx

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章