Nikolas II Posted November 26, 2008 Posted November 26, 2008 Hello. I want to add a reference to a dll file named SciLexer.dll (scintilla/notepad++ related dll) but it gives me this error: "A reference to <file directory here> could not be added.Please make sure that the file is accessible and that it is a valid assembly or COM component." Any ideas? Quote
MrPaul Posted November 27, 2008 Posted November 27, 2008 Using a standard DLL If it isn't a .NET or COM DLL, then it is likely that the DLL is a "standard" DLL which exports one or more functions. There are tools which allow you to find out the names of functions exported by a DLL, but the names and even signatures of the functions are unlikely to be enough to know how to use the DLL properly. Calling standard DLL functions from .NET can be achieved using DllImport and marshalling. This is a common technique for invoking native Win32 functions, and there is plenty of information in these forums relating to that - providing, of course, you know how the DLL works. Do you have any documentation for the DLL? Good luck :cool: Quote Never trouble another for what you can do for yourself.
Nikolas II Posted November 28, 2008 Author Posted November 28, 2008 Re: Using a standard DLL If it isn't a .NET or COM DLL, then it is likely that the DLL is a "standard" DLL which exports one or more functions. There are tools which allow you to find out the names of functions exported by a DLL, but the names and even signatures of the functions are unlikely to be enough to know how to use the DLL properly. Calling standard DLL functions from .NET can be achieved using DllImport and marshalling. This is a common technique for invoking native Win32 functions, and there is plenty of information in these forums relating to that - providing, of course, you know how the DLL works. Do you have any documentation for the DLL? Good luck :cool: Nope,I don't have Quote
Leaders snarfblam Posted November 30, 2008 Leaders Posted November 30, 2008 Re: Using a standard DLL The process of interoperating with a non-COM DLL is formally called P/Invoke (platform invoke). Like MrPaul said, needing documentation is a fact of life working with standard DLLs. If you do get that documentation, Microsoft has a comprehensive tutorial on P/Invoke. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts