PInvoke Marshalling....
- From: "Daniel Bass" <danREMOVEbass@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Oct 2007 15:06:38 +0100
Greetings!
I'm trying to call this method in a c# app...
SNAPIDLL_API int __stdcall SNAPI_SetCapabilitiesBuffer(HANDLE
DeviceHandle, unsigned char *pData, long max_length);
So far I've got this:
[DllImport("Dependencies\\SNAPI.DLL")]
public static extern int SNAPI_SetVersionBuffer(IntPtr DeviceHandle,
StringBuilder pData, long max_length);
Keep getting a PInvokeStackImbalance error and I think it's the 2nd paramter
pData because I've referenced the device handler and the long typedef is
pretty obvious.
For the 2nd paramter I've tried the following without success:
byte[]
char[]
string
StringBuilder
[MarshalAs(UnmanagedType.AnsiBStr)] string
HELP!
Thanks.
Dan.
.
- Follow-Ups:
- Re: PInvoke Marshalling....
- From: Nicholas Paldino [.NET/C# MVP]
- Re: PInvoke Marshalling....
- Prev by Date: Re: System.OutOfMemoryException while Creating PDF files
- Next by Date: Re: rasdial returns 632 on x64 bit Vista nd Windows XP
- Previous by thread: Creating a dataset?
- Next by thread: Re: PInvoke Marshalling....
- Index(es):
Relevant Pages
|
Loading