Error Message

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
 
T

Tom Shelton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top