none
Unable to find an entry point in DLL RRS feed

  • Question

  • Runtime Message:

    Unable to find an entry point named 'WaitForStart' in DLL 'Interface.dll'.

     

    Code:

    //In C++ Win32 DLL  (Interface.dll)
    In the header:
    #ifdef INTERFACE_EXPORTS
    #define INTERFACE_API __declspec(dllexport)
    #else
    #define INTERFACE_API __declspec(dllimport)
    #endif

    typedef unsigned long FT_STATUS;


    In the CPP:

    INTERFACE_API  FT_STATUS WaitForStart(void)
    {
     while (!startFlag) spin();
     return 0;
    }


    //In C++ CLR DLL:  (InterfaceCLR.dll)

    using namespace System::Runtime::InteropServices;

    typedef unsigned long FT_STATUS;


    #define FT_PREFIX [DllImport("Interface.dll")]

    FT_PREFIX  FT_STATUS WaitForStart(void);

     

    void InterfaceToStuff:Tongue Tiedtart(){
     FT_STATUS i = WaitForStart();  <-- Error happens here
    }

     

    I get the message as above on the 2nd last line

     

    If I use the object browser in VS2005 I can see the function in the DLL.

    I've spent hrs on this so any ideas would be appreciated.

     

    Cheers

     

    Monday, May 12, 2008 8:19 AM

Answers

  • Put extern "C" in front of the function declaration to prevent the C++ compiler from mangling the function name.  Or use Dumpbin.exe /exports on your DLL to find the mangled name.
    Monday, May 12, 2008 9:57 AM
    Moderator

All replies

  • Put extern "C" in front of the function declaration to prevent the C++ compiler from mangling the function name.  Or use Dumpbin.exe /exports on your DLL to find the mangled name.
    Monday, May 12, 2008 9:57 AM
    Moderator
  • Thanks for that.  It worked.

    For the record I placed extern "C" in front of the function declaration in the Win32 DLL project in the source and header files preceding what was already there for the function in both.

     

    Monday, May 12, 2008 1:52 PM