Error Message

  • Thread starter Thread starter John
  • Start date Start date
J

John

What does this mean?

Managed Debugging Assistant 'PInvokeStackImbalance' has detected a
problem in 'C:\My Documents\Microsoft Visual
Basic\CommuniDent\CommuniDent\bin\CommuniDent.vshost.exe'.
Additional Information: A call to PInvoke function
'CommuniDent!CommuniDent.frmMain::sndPlaySound' 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
 
What does this mean?

Managed Debugging Assistant 'PInvokeStackImbalance' has detected a
problem in 'C:\My Documents\Microsoft Visual
Basic\CommuniDent\CommuniDent\bin\CommuniDent.vshost.exe'.
Additional Information: A call to PInvoke function
'CommuniDent!CommuniDent.frmMain::sndPlaySound' 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

Hmmm, that usually means a bad declare statement. Did you declare
sndPlaySound? If you did, can yo post the declare? It should look
something like:

declare auto function sndPlaySound lib "winmm.dll" (byval lpszSound as
string, byval fuSound as integer) as boolean

My guess is that you declared the return and the fuSound parameter as
Long. That is incorrect in VB.NET because the datatype sizes have
changed. In .NET a Long is a 64-bit integer, not 32-bit as in VB6.
 
Back
Top