On Dec 1, 12:22 pm, Andrew Falanga <[EMAIL PROTECTED]> wrote:
> Ok.  My C++ code now looks like this:
>
> <dllinclude.h>
> extern "C" {
> __declspec(dllexport) Result_t __stdcall CheckImage(char *, char *,
> struct parms);
>
> }
>
> The dll project in my solution builds just fine.  Then, in the C#
> project, I have:
>
> // all appropriate declarations and such including a structure defined
> to be identical to the structure the function expects
>
> [DllImport("my.dll")]
> extern static CheckImage(String arg1, String arg2, parms);
>
> I'm still getting the exception that the entry poing CheckImage()
> cannot be found in the dll.  I've copied my dll to c:\windows\system32
> thinking that the DllImport is trying to look there since I'm not
> passing a fully qualified path.  What else am I missing?
>
> Andy
>

Problem solved!  The C++ code, in the dll project of this solution,
was not #include'ing the header files into the source files.  Certain
files in this project had a <filename>.h and <filename>.cpp
relationship where <filename> was the same.  I missed this issue
because every time I write C++, or C, code in this fashion, I always
#include the header file in my source file.  Because I didn't write
the code I am using, I made the mistake of assuming that *everyone*
else did it in this fashion.  So, #include'ing the header files into
the source files solved the problem because then the compiler knew
what to export.

Andy

Reply via email to