Help Please
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Help Please

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Help Please

    A call to PInvoke function 'keys!keys.Form1::GetAsyncKeyState' 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.


    I get the above error message when I run my program.What does this mean?

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Help Please

    It sounds like you are using PInvoke to call a function, but you have not declared it correctly. The signatures do not match. For example, if you were trying to call a function

    Code:
    void Foo(int* i)
    but you declared it as

    Code:
    private static extern void Foo(byte* i);
    that would cause an error, because you have declared the function incorrectly.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Help Please

    How did you declare GetAsyncKeyState()?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Mar 2009
    Posts
    2

    Re: Help Please

    Thank u BigEd781.
    Please send me the correct syntax of GetAsyncKeyState.
    Thank u again 4 replying!!!!

  5. #5
    Join Date
    Jun 2008
    Posts
    2,477

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center