Solved

Cant 'Sleep' using this facility in VB.net 2005 brings errors

Posted on 2008-06-19
3
242 Views
Last Modified: 2010-04-21
Hi I have this simple code

 Private Sub Button44_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button44.Click

        Sleep(5000)

        MsgBox("Hi")

    End Sub

the program waits and then at the end of the time throws up and error

A call to PInvoke function 'Form Elements BetAuto!Form_Elements_BetAuto.Module1::Sleep' 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 am I doing wrong here ?

Michal
0
Comment
Question by:MichMat
  • 2
3 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
Comment Utility
I would do as

System.Threading.Thead.Sleep(5000)
System.Windows.Forms.MessageBox.Show("Hi")
0
 

Author Comment

by:MichMat
Comment Utility
Finaly I can get to sleep :)
0
 

Author Closing Comment

by:MichMat
Comment Utility
spot on answer
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now