PInvoke and AdjustWindowRect

  • Thread starter Thread starter Tom Dacon
  • Start date Start date
T

Tom Dacon

I've just converted a VS2003 application to VS2005, and a PInvoke call to
AdjustWindowRect which apparently worked fine in VS2003 is pulling a runtime
error under VS 2005, as follows:

A call to PInvoke function
'Graphics!DSC.Utilities.Graphics.Win32RECT::AdjustWindowRect' has unbalanced
the stack. This is likely because the managed PInvoke signature does not
match the unmanaged target signature. Check that the calling convention and
parameters of the PInvoke signature match the target unmanaged signature.

My declaration for AdjustWindowRect looks like this:

[DllImport("user32.dll", EntryPoint="AdjustWindowRect")]
public static extern bool AdjustWindowRect(ref Win32RECT clientCorners,
ulong dwStyle, bool bMenu);

my Win32RECT struct, which is impersonating a Windows API RECT struct looks
in part like this:
 
Back
Top