I am trying include c++ library (DLL) in my c# project but every time I do that I get following error message in VS2008, any suggestions?
EDIT: It's a C++ MFC DLL
--------------------------- Microsoft Visual Studio --------------------------- A reference to 'C:\Users\cholachaguddapv\Desktop\imaging.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
The ctype. h header file of the C Standard Library declares several functions that are useful for testing and mapping characters. All the functions accepts int as a parameter, whose value must be EOF or representable as an unsigned char.
C libraries store files in object code; during the linking phase of the compilation process ( Compilation Process) files in object code are accessed and used. It is faster to link a function from a C library than to link object files from a separate memory sticks or discs.
The C standard library provides macros, type definitions and functions for tasks such as string handling, mathematical computations, input/output processing, memory management, and several other operating system services.
A library in C is a collection of header files, exposed for use by other programs. The library therefore consists of an interface expressed in a . h file (named the "header") and an implementation expressed in a .
If it is a "normal" DLL (not COM, not managed C++), you cannot add a reference like this. You have to add p/invoke signatures (external static method definitions) for the exports you want to call in your DLL.
[DllImport("yourdll.dll")]
public static extern int ExportToCall(int argument);
Have a look at the DllImport attribute in the online help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With