PDA

View Full Version : What are the exact PInvoke signature of FPDFBookmark_GetTitle


hashimsaleem
November 8th, 2007, 08:50 AM
Hi,

I am using the following signatures for FPDFBookmark_GetTitle()

// FPDFBookmark_GetTitle: Get title of a bookmark
[DllImport("fpdfview.dll", SetLastError = true)]
public static extern ulong FPDFBookmark_GetTitle(IntPtr bookmark, IntPtr buffer, ulong buflen);

But i m getting PInvokeStackImbalance mda activated.

Can someone point out what I am doing wrong?

I am programming in Visual Studio 2005 and the language is C#.

Regards,
Hashim Saleem

hashimsaleem
November 12th, 2007, 02:49 AM
47 views and no reply so far?

hashimsaleem
November 12th, 2007, 07:59 AM
I have found the correct signature to be

// FPDFBookmark_GetTitle: Get title of a bookmark
[DllImport("fpdfview.dll", SetLastError = true)]
public static extern uint FPDFBookmark_GetTitle(IntPtr bookmark, IntPtr buffer, uint buflen);

Thanks.

hashimsaleem
November 12th, 2007, 08:27 AM
More comfortable signature is

// FPDFBookmark_GetTitle: Get title of a bookmark
[DllImport("fpdfview.dll", SetLastError = true)]
public static extern uint FPDFBookmark_GetTitle(IntPtr bookmark, [MarshalAs(UnmanagedType.LPTStr)] StringBuilder buffer, uint buflen);

diamondblast
October 17th, 2008, 11:08 AM
you are really really good...
all the thread is yours :) both Q and A
well, I've ruined it