DLLImport Error: EntryPointNotFound

  • Thread starter Thread starter PhX.ZA
  • Start date Start date
P

PhX.ZA

When i Try To Call An External function In An Unmanaged DLL (*.lib) I
Get An Exception "An unhandled exception of type
'System.EntryPointNotFoundException' occurred in qtextpathlinker.dll"

This Is The Wrapper call Used In Side My C# DLL "qtextpathlinker.dll":
[DllImport("InterOp.dll",EntryPoint="CreateQPathTextBSC",CallingConvention=CallingConvention.Cdecl,PreserveSig=false)]
internal unsafe static extern IntPtr* CreateQPathTextBSC(float*
points,byte* types,int PointsCount);

The Types In The C++ lib file and my C# File Are Identical.
Can Any One Help Me Please?
Andrew.
 
PhX.ZA,

Without seeing the header file, it's hard to say that the types are
identical.

First, you don't need to set the PreserveSig or the EntryPoint fields,
since neither have an effect in this case.

You have no need to return a pointer to an IntPtr, you should just
return an IntPtr. On top of that, if the pointers to the values passed in
represent arrays that are not changed, you can actually declare them as
arrays.

Finally, the EntryPointNotFoundException indicates that the dll is not
found. Are you sure the unmanaged dll is in the path that LoadLibary would
use to find it?

Hope this helps.
 
| When i Try To Call An External function In An Unmanaged DLL (*.lib) I
| Get An Exception "An unhandled exception of type
| 'System.EntryPointNotFoundException' occurred in qtextpathlinker.dll"
|
| This Is The Wrapper call Used In Side My C# DLL "qtextpathlinker.dll":
|
[DllImport("InterOp.dll",EntryPoint="CreateQPathTextBSC",CallingConvention=CallingConvention.Cdecl,PreserveSig=false)]
| internal unsafe static extern IntPtr* CreateQPathTextBSC(float*
| points,byte* types,int PointsCount);
|
| The Types In The C++ lib file and my C# File Are Identical.
| Can Any One Help Me Please?
| Andrew.


Looks like CreateQPathTextBSC is not an exported C function or has a
different signature!

Willy.
 
Back
Top