Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. PInvokeStackImbalance (Net 2.0)

PInvokeStackImbalance (Net 2.0)

Scheduled Pinned Locked Moved .NET (Core and Framework)
dotnetwindows-admindata-structuresregexhelp
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angelo Cresta
    wrote on last edited by
    #1

    from MS: The PInvokeStackImbalance managed debugging assistant (MDA) is activated when the CLR detects that the stack depth after a platform invoke call does not match the expected stack depth given the calling convention specified in the DllImportAttribute attribute as well as the declaration of the parameters in the managed signature... ok, understood, by my code is: Friend NotInheritable Class NativeMethods Private Sub New() End Sub Declare Function GetKeyState Lib "user32" Alias "GetKeyState" (ByVal _ nVirtKey As Long) As Integer End Class Now, how should I change the parameters to match those MDA is looking for?!? Already tried to disable MDA via registry, but I think a solution is not covering an error ... Thanks in advance /// Angel

    A 1 Reply Last reply
    0
    • A Angelo Cresta

      from MS: The PInvokeStackImbalance managed debugging assistant (MDA) is activated when the CLR detects that the stack depth after a platform invoke call does not match the expected stack depth given the calling convention specified in the DllImportAttribute attribute as well as the declaration of the parameters in the managed signature... ok, understood, by my code is: Friend NotInheritable Class NativeMethods Private Sub New() End Sub Declare Function GetKeyState Lib "user32" Alias "GetKeyState" (ByVal _ nVirtKey As Long) As Integer End Class Now, how should I change the parameters to match those MDA is looking for?!? Already tried to disable MDA via registry, but I think a solution is not covering an error ... Thanks in advance /// Angel

      A Offline
      A Offline
      Angelo Cresta
      wrote on last edited by
      #2

      I've found!I was sure that nVirtKey was a Long, but It's a Short (MSDN[^]) sorry ... Angel

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups