Link to home
Start Free TrialLog in
Avatar of tommym121
tommym121Flag for Canada

asked on

C# - How to add unmanaged dll to a c# project

I have a unmanaged 'C' dll  I need to used in a C# project.  I have created dllimport for my 'C' functions.  I was unable to add reference.  How do I do?  When I right click  on the project and select add reference.  I got an error whether I choose extension of assemblies or COM. See attached screen shots.  I am currently using Visual Studio 2010.
Capture1.JPG
Capture2.JPG
Avatar of kaufmed
kaufmed
Flag of United States of America image

Is the DLL a COM DLL? If not, then you will need to import the functions by name using the DLLImport attribute. Otherwise, if the DLL is a COM DLL, then you may need to register the DLL on your system using regsvr32.exe.
Avatar of tommym121

ASKER

It is not a COM dll.  So I don't need use to Add reference. Am I right?
SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks