Can't find PInvoke DLL '110506Demoptt.dll'.

I am trying to debug a C++ code from C# Device Appliation. When i reached calling the C++ function from C# it gives "Can't find PInvoke DLL '110506Demoptt.dll'.".

The following is the code sipnet.

public static CallBackDelegate myDelegate;

[DllImport("110506Demoptt.dll")]

private static extern void SetCallBackPointer(CallBackDelegate myDelegate);

static void Main()

{

myDelegate = new CallBackDelegate(CallbackFunction);

SetCallBackPointer(myDelegate); \\ When i reached this place i am getting the error "Can't find

\\ PInvoke DLL '110506Demoptt.dll'."

}

What could be the possible solution for this.

Thanks in advance.



Answer this question

Can't find PInvoke DLL '110506Demoptt.dll'.

  • Mark Shoesmith

    I have the same problem. I tried putting the DLL in the Windows and in the Application folder -- still doesn't work.

    The dumpbin produces:

    1C2 machine (Thumb)
    32 bit word machine

    I am trying to install this on Treo 750, WM5 and do a DLLImport from .NET framework.

    Thank you for your help!

    Evgueni



  • NoGoodNameExists

    so which is the correct way to copy a .dll file into an app directory on the pocket pc I have ActiveSync 4.0 and VS2005.

    Regards,

  • xnpa555

    The exception says what it says - it can' find the dll. Make sure it exists either in the application directory or /Windows


  • Faizel

    Ensure that your dll is built for a correct platform

  • MikeSmo

    hi

    I have the same problem. The dll is in the same directory as the running program, but it doesn't accept my dll.

    I ran the dumpbin-stuff you suggested and it responded like this

    1C0 machine (ARM)

    32 bit word machine

    I'm trying to run the program on an Pocket PC 2003 device. The device and the emulator gives the same error.


  • cgoodyear

    You can either include the dll in your project and in the properties mark it as Content and Copy Always, or just copy it manually using Explorer and ActiveSync. This will not help you with making sure your DLL is built for the correct platform. To check the platform from the Visual Studio program group in the start menu launch Visual Studio Command Prompt (under Visual Studio tools), then change directory to where your DLL is located and run:

    dumpbin /headers 110506Demoptt.dll |find "machine"

    It will print something like:

    14C machine (x86)

    or

    1C2 machine (Thumb)

    Let me know which on it is and on what platform are you trying to use it



  • mikeonbike

    I have the same problem. i try to copy my .dll into program files/ myapp/ directory with windows explorer and it still gives me the same error. any idea

  • Can't find PInvoke DLL '110506Demoptt.dll'.