Martin,
I'm not familiar with the Acrobat API but I've done some work with other APIs. Generally, I find the issues with passing parameters are related to marshalling. When you define the exported API function for use in your code you have to marshal string parameters as UnmanagedType.LPStr as in this definition:
[DllImport("piapi32.dll", SetLastError = false,
CharSet = CharSet.Ansi, EntryPoint = "piut_login",
CallingConvention = CallingConvention.StdCall)]
protected static extern Int32 piut_login(
[MarshalAs(UnmanagedType.LPStr)] String Username,
[MarshalAs(UnmanagedType.LPStr)] String Password,
ref Int32 Access);
Note that the returned integer and referenced integer parameter didn't require any special treatment.
Hope this helps.
What you don't know can hurt you!
|