We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

PInvokeStackImbalance Error

Hi

The following error:
============================================
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'Syncfusion.Shared.Base!Syncfusion.Runtime.InteropServices.NativeMethods::ImageList_DrawEx' 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.
=================================================
I trying to build my project in framework 2.0.
The version of the Syncfusion is 3.0.1.0 .
What`s I do? Please help me!!!

The error happened in this line:
Application.Run(frmPrincipal.GetInstance());
where call my main program.


6 Replies

HA haneefm Syncfusion Team April 24, 2007 08:35 PM UTC

Hi Marcia,

The version that you are using currently is not compatible with VS 2005. If you plan to work with VS 2005 (.NET 2.0) then, Essential Studio version 4.x is recommended. This version is fully compatible and has been tested with .NET 2.0. This also supports VS 2002 and VS 2003 frameworks.

Please refer the below link to download the latest version
http://www.syncfusion.com/downloads/latestversion/default.aspx

Best regards,
Haneef


MA Marcia April 25, 2007 12:29 PM UTC

thanks for your reply!!

but don`t have other way to correct this bug?

>Hi Marcia,

The version that you are using currently is not compatible with VS 2005. If you plan to work with VS 2005 (.NET 2.0) then, Essential Studio version 4.x is recommended. This version is fully compatible and has been tested with .NET 2.0. This also supports VS 2002 and VS 2003 frameworks.

Please refer the below link to download the latest version
http://www.syncfusion.com/downloads/latestversion/default.aspx

Best regards,
Haneef


AD Administrator Syncfusion Team April 26, 2007 12:40 PM UTC

The problem is a function signature. In order to work in .NET 2.0,

internal static extern bool ImageList_DrawEx( IntPtr himl, int i, IntPtr hdcDst, int x,
int y, int dx, int dy, long rgbBk, long rgbFg,
uint fStyle
);

should be

internal static extern bool ImageList_DrawEx( IntPtr himl, int i, IntPtr hdcDst, int x,
int y, int dx, int dy, uint rgbBk, uint rgbFg,
uint fStyle
);


I do not know of any simple work around for this other than getting a new library build.


MA Marcia April 26, 2007 01:41 PM UTC

Hi Clay!!!!

I have put this code in my application and is don`t work. This component
had that to be
compatible with the .Net 2.0. Why is don`t ?

>The problem is a function signature. In order to work in .NET 2.0,

internal static extern bool ImageList_DrawEx( IntPtr himl, int i, IntPtr hdcDst, int x,
int y, int dx, int dy, long rgbBk, long rgbFg,
uint fStyle
);

should be

internal static extern bool ImageList_DrawEx( IntPtr himl, int i, IntPtr hdcDst, int x,
int y, int dx, int dy, uint rgbBk, uint rgbFg,
uint fStyle
);


I do not know of any simple work around for this other than getting a new library build.


AD Administrator Syncfusion Team April 26, 2007 04:12 PM UTC

3.0.1.0 is not compatible with .NET 2.0. 3.1.0. was released in Dec of 2004, many months before .Net 2.0 was released (Nov 2005?).

When you say you put that change in your code, do you mean you recompiled the syncfusion libraries? There are likely other changes of that same nature that were made when we moved from 3.3 to 4.x to fully support .NET 2.0.


MA Marcia April 26, 2007 06:11 PM UTC

Thanks for your reply. But I believed that the components were compatible independent of framework version. This is strange because, others components in my project continue working.
A question: Each new version of .Net I go to have that to buy the Essential Grid?

Thanks!!!

Loader.
Live Chat Icon For mobile
Up arrow icon