I'm using Microsoft C# 2010 Express with the FrameLink Express drivers from Imperx. When I try to load the DLL at runtime, I get an exception:<blockquote>
<em>Unable to load DLL 'VCECLB.dll': The specified module could not be found. (Exception from HRESULT:0x8007007E)</em></blockquote>
If I try to add the DLL as a reference, I get this message:<blockquote>
<em>A reference to 'C:\\VCECLB.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.</em></blockquote>
Is this an Express problem (i.e. some limitation with Express causing the problem)? I believe the source for the DLL is written in C++, but I wouldn't think that would matter.</li> <li>
Is there a different way to reference the DLL and/or add it to the project? Something I'm doing wrong?</li> </ol>
Finally, I've tried adding both the x86 and x64 versions, debug and release. Same failure to add as a reference every time.Answer1:
That DLL doesn't seem to be .NET (nor COM) code - therefore you cannot load it, nor add a reference to it.
Doesn't have anything to do with your Express version - it's just not a .NET "compatible" DLL and thus you can't load or reference it.
In order to use its functionality, you'll probably have to dive into more "arcane" (and more elaborate and more complicated) methods of calling raw C++ code from .NET - or find a .NET compatible counterpart or version of it.Answer2:
Actually, the answer appears to be in the first line of the message: Unable to load DLL 'VCECLB.dll': The specified module could not be found. (Exception from HRESULT:0x8007007E It says it cannot find the DLL, not that the DLL is not compatible. The DLL should be located with the other DLLs with your program, and you need to add the DLL to the solution.
If by some chance the DLL is compiled as Native C/C++ (i.e., Not .NET style), it can be called from a C/C++ that is a .NET style, but not a C# routine.
So, if the problem is that the module can be found but not loaded, you need to write a C++ (.NET) routine to call from your C# routine (.NET) to call the C++ (Not .NET).
All code that talks directly to hardware must do this at some level. Most do this for you using multiple DLLs.