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
On Nov 26, 12:15 am, "Paulo Coutinho" <[EMAIL PROTECTED]> wrote:
> I think you forgot the : __stdcall
>
> http://www.geocities.com/yongweiwu/stdcall.htm
>
> 2008/11/25 Andrew Falanga <[EMAIL PROTECTED]>
>
>
>
>
>
> > Hi,
>
> > I've gotten much help on-line about this and have the code implemented
> > to use the unmanaged dll in my C# code. Now, however, the problem
> > seems to be with the calling of the function that I need from the
> > dll. The DLL, by the way, is also a project in this VS solution.
>
> > So, I have the following:
>
> > using System.Runtime.InteropServices;
>
> > [DllImport("the.dll")]
> > static extern bool TheFunction(<args>);
>
> > // then using the function as one would expect
>
> > bool returnIsTrue = TheFunction(args[0]);
>
> > Now, when I start a new debugging instance for the program I'm greeted
> > with, "EntryPointNotFoundException, Unable to find an entry point in
> > 'the.dll' named 'TheFunction'." I know what an entry point is, even
> > for a DLL file, but why should this need an entry point for the DLL?
> > I simply want to call this function from the DLL.
>
> > I've found the appropriate declarations for the functions I need in
> > the appropriate header files for this C++ DLL project in my solution
> > and put the, "__declspec(dllexport)," in front of the function
> > declarations. I thought that would take care of this, but it hasn't.
> > What am I missing?
>
> > Thanks for any help, but if this forum isn't the right place, sorry.
> > Please point me to a better forum.
>
> > Andy
>
> --
> Atenciosamente,
> Paulo Coutinho.
> Site:www.prsolucoes.com
> Msn: [EMAIL PROTECTED]
> Skype: paulo.prsolucoes