DLLImport Error: EntryPointNotFound

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
W

Willy Denoyette [MVP]

| 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top