Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LockWindowUpdate() problem with .NET 2.0

Status
Not open for further replies.

miket26

Programmer
Apr 13, 2004
63
CA
Hello,

I had a program in .NET 1.1 that worked fine, but now that I'm trying to implement in the .NET 2.0 with VS 2005, it doesn't work. It doesn't even through an exception, but just crashes. Here is a snippet of the code:

Private Declare Function LockWindowUpdate Lib "user32.dll" (ByVal hwnd As Long) As Long

private sub performFreeze()
LockWindowUpdate(Me.Handle.ToInt32) 'lock window

' .... code executed here

LockWindowUpdate(0) ' unlock window
End Sub

This is the error that appears:
"A call to PInvoke function 'microSql 2!microSql_2005.myQuery::LockWindowUpdate' 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'd greatly appreciate any help with this, as the program worked graet before , and I'd hate to have to redo it.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top