Exception EntryPointNotFoundException

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ben (Ben_at_discussions.microsoft.com)
Date: 08/06/04


Date: Thu, 5 Aug 2004 18:27:02 -0700

I am trying to call into an unmanaged C++ DLL that exposes 1 function (using
__stdcall) defined as follows in a header:

BOOL BROWSE_API BrowseForData(HWND hwndOwner, LPWSTR defaultComment, LPWSTR
intialDirectory, LPWSTR path, int length);

BROWSE_API is the standard __declspec(dllexport) definition.

I can call the function from another unmanaged application without any
problems. However I get an EntryPointNotFoundException whenever I call from C#

In my C# program I have the function declared as:
[DllImport("DBBrowser.dll", CharSet=CharSet.Unicode)]
public static extern int BrowseForData(IntPtr hwndOwner, string
defaultComment, string intialDir, StringBuilder path, int length);

The first two strings are really inputs, and originally defined as LPCWSTR
in the C++ function, but that didn't work either.

Any help on this would be appreciated greatly!

Thanks in advance,
Ben



Relevant Pages

  • Re: accessing C++ functions
    ... LPWSTR should be a pointer ... it means LONG POINTER toWIDE / double byte STRING. ... It is probably due to the types I'm declaring for the structure ...
    (microsoft.public.dotnet.languages.vb)
  • Re: concatenate WCHAR*
    ... > LPWSTR SayHello ... > return kTemp; ... > i want to add "Hello " to strName. ... not safe to prepend another string to it. ...
    (microsoft.public.vc.language)
  • Re: String between unmanaged and managed
    ... LPSTR, not LPWSTR. ... The last test I make was to declare text as wchar_t*, ... Windows CE returns a Unicode string, ... In case unmanaged1 I always receive correct string, ...
    (microsoft.public.windowsce.app.development)
  • Re: dynamically allocate array variable of type LPWSTR
    ... int Foo(LPWSTR *wstr) ... Make sure you genuinely want a pointer to an LPWSTR. ... However pointers to pointers are often useful. ...
    (comp.lang.c)
  • Re: dynamically allocate array variable of type LPWSTR
    ... LPWSTR is not a standard type but part of the win32 API. ... LPWSTR is a pointer type, ... int count = Foo; ...
    (comp.lang.c)