473,320 Members | 1,988 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,320 software developers and data experts.

PInvokeStackImbalance was detected

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 AccessibleObjectFromEvent. The signature and the defination shown below.

Signature:
Expand|Select|Wrap|Line Numbers
  1. [DllImport("oleacc.dll")]
  2.             public static extern uint AccessibleObjectFromEvent(IntPtr hwnd, long dwObjectID, long dwChildID, out IAccessible iAccessible, out object pvarChild);
Defination:

Expand|Select|Wrap|Line Numbers
  1. Accessibility.IAccessible iAccessible = null; //AccessibilityObject;
  2. object obj = null;
  3. long hr = oleacc.AccessibleObjectFromEvent(hwndMsg, idObject, idChild, out iAccessible, out obj);
but I am getting the following error:

PInvokeStackImbalance was detected
Message: A call to PInvoke function 'Ravi project!Ravi_project.winevent+oleacc::AccessibleOb jectFromEvent' 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.


Please help me in above problem.
May 20 '07 #1
1 3060
kenobewan
4,871 Expert 4TB
Managed debug assistants (MDAs) are telling you that something is seriously wrong in your application. Find the unmanaged method signature for the method you are trying to call and write the correct P/Invoke signature.
May 20 '07 #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...
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:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.