TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Patrick van der Willik
NA
1
0
PInvokeStackImbalance in .NET 2.0 with Cards.dll
Dec 30 2005 9:49 AM
I'm working on a card game in C#, and I figured, why not use the cards.dll for the drawing. So I wrote a small wrapper class around it, and it worked(Under .NET 1.1).
So I proceeded to port most of the application to 2.0, and get it networked using
Remoting. However, when I start drawing, I get a PInvokeStackImbalance exception:
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'ZweedsPesten!ZweedsPesten.CardsDll::cdtDraw' 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.
As the class worked under .NET 1.1, I took an example from Programmers Heaven using the DLL aswell, and it crashed aswell. I have no idea what the problem is. According to the MSDN, it's a stack corruption, which seems odd to me as it used to work.
My code can be found here:
http://upload.toolmaker.nl/CardsDll1.cs
Toolmaker
Reply
Answers (
0
)
Mail Application generating error
PlatformInvoke-Serial Port Programming