473,395 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PInvokeStackImbalance was detected?

jamesd0142
469 256MB
Can Anyone advise?
i found the following code online:
Expand|Select|Wrap|Line Numbers
  1. Public Declare Auto Function SetCursorPos Lib "User32.dll" (ByVal X As Integer, ByVal Y As Integer) As Long
  2.     Public Declare Auto Function GetCursorPos Lib "User32.dll" (ByRef lpPoint As Point) As Long
  3.     Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
  4.     Public Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
  5.     Public Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
  6.     Public Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down
  7.     Public Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up
  8.     Public Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down
  9.     Public Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up
  10.  
When i use this code was was part of the code i found:
Expand|Select|Wrap|Line Numbers
  1. mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  2.         mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  3.  
I get an error...

Please look at attchment...

Can anyone explain it?

James
Attached Images
File Type: jpg Error.JPG (19.9 KB, 244 views)
Apr 15 '08 #1
1 1963
jamesd0142
469 256MB
Never mind..

This seems to work now...

Expand|Select|Wrap|Line Numbers
  1. Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
  2.     Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move    
  3.     Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down    
  4.     Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up    
  5.     Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move    
  6.     Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
  7.     Private Const MOUSEEVENTF_MIDDLEUP = &H40
  8.     Private Const MOUSEEVENTF_RIGHTDOWN = &H8
  9.     Private Const MOUSEEVENTF_RIGHTUP = &H10
  10.  
  11. mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 1)
  12.         mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  13.  
Apr 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Chandika | last post by:
Hi all, One of my database was suspected, So I try to recover database then it gives this error Err. 823 Torn Page Detected 823, ... 24, spid51 i/o error Torn Page (Detected) during read...
3
by: Tim Reynolds | last post by:
I support a .Net application running on a SERVER accessing MF Db2 data. Occasionally, we have some type of connection problem that we have been unable to debug up to this point. We typically...
3
by: Laura | last post by:
I've just installed the DB2 Run-time client in a Solaris machine. Then I finnish the installation configuring the connection: 1. machine catalog was OK: ========================== $ db2 catalog...
32
by: Clunixchit | last post by:
How can i read lines of a file and place each line read in an array? for exemple; array=line1 array=line2 ...
2
by: Marek | last post by:
Hi I'm trying to call a native C++ dll using the following code (both C# and C++ code segments included). When I make the call to the method (AddTwoDoubles) that has no return value all is fine. ...
0
by: MJKulangara | last post by:
I have an ap written in vb.net using 1.2 framework that makes a call to a c++ dll. The executable I create runs just fine, but when I run the ap in debug mode I get a PInvokeStackImbalance error....
1
by: urbansound | last post by:
Hi, I'm having trouble tracking down a PInvoke error in the MySqlDriverCS lib, which is detected even in the author's samples converted to VS v8 .Net 2.0. The calling maze is provided, but the...
1
by: raghavendra2007 | last post by:
Hi, I am trying to develop the ScreenReader in C#, I need to use IAccessibility to access the system events. Before that I should require to get the IAccesibility object using...
2
by: John M. Gamble | last post by:
I'm getting this message in Visual Studio 2005: PInvokeStackImbalance was detected Message: A call to PInvoke function 'Refresh!Refresh.Main::WNetAddConnection2' has unbalanced the stack. ...
2
by: linuxfedora | last post by:
I wrote a class for playing wav file, the code: class SoundPlayer { // flag values for SoundFlags argument on PlaySound public int SND_SYNC = 0x0000; // play synchronously (default) public...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.