>and GetLastError returns 0).
Don't call GetLastError from managed code. Add SetLastError=true to
the dllImport attribute and then call Marshal.GetLastWin32Error
instead.
>Im guessing something is wrong with the struct i am passing in, but
>what?
It's a class, not a struct. That's the problem. Change it to a struct,
or remove the ref modifier on the parameter.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
ziphnor@gmail.com - 27 May 2006 22:04 GMT
> >Im guessing something is wrong with the struct i am passing in, but
> >what?
>
> It's a class, not a struct. That's the problem. Change it to a struct,
> or remove the ref modifier on the parameter.
I feel like an idiot :) This solved the problem, thanks.