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. Visual Basic
  4. PInvoke Imbalance Stack function

PInvoke Imbalance Stack function

Scheduled Pinned Locked Moved Visual Basic
data-structuresregex
4 Posts 3 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.
  • S Offline
    S Offline
    sundar_mca
    wrote on last edited by
    #1

    A call to PInvoke function 'Project1!Project1.Module1::NGIMAPBR_AutoDetectAndDecode2DBarcode' 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. :((

    G 1 Reply Last reply
    0
    • S sundar_mca

      A call to PInvoke function 'Project1!Project1.Module1::NGIMAPBR_AutoDetectAndDecode2DBarcode' 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. :((

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Have you tried what it says?

      --- single minded; short sighted; long gone;

      S 1 Reply Last reply
      0
      • G Guffa

        Have you tried what it says?

        --- single minded; short sighted; long gone;

        S Offline
        S Offline
        sundar_mca
        wrote on last edited by
        #3

        Public Declare Function NGIMAPBR_AutoDetectAndDecode2DBarcode Lib "imgap32.dll" Alias "_NGIMAPBR_AutoDetectAndDecode2DBarcode@28" (ByVal hInputDIB As Long, ByVal rectSearchLocation As rect, ByVal lSearchOption As Long, ByRef lNoofBarcodes As Long, ByVal lphBarcodeInformation As Long, ByVal lphreserved1 As Long, ByVal lphreserved2 As Long) As Long i used the above function it says thet the struct Rect must be used as the marshall attribute to be passed as argument

        D 1 Reply Last reply
        0
        • S sundar_mca

          Public Declare Function NGIMAPBR_AutoDetectAndDecode2DBarcode Lib "imgap32.dll" Alias "_NGIMAPBR_AutoDetectAndDecode2DBarcode@28" (ByVal hInputDIB As Long, ByVal rectSearchLocation As rect, ByVal lSearchOption As Long, ByRef lNoofBarcodes As Long, ByVal lphBarcodeInformation As Long, ByVal lphreserved1 As Long, ByVal lphreserved2 As Long) As Long i used the above function it says thet the struct Rect must be used as the marshall attribute to be passed as argument

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Apparently, you're trying to use a VB6 signature in VB.NET code. That won't work without some conversion. For example, a Long in VB6 is a 32-bit signed integer, while in VB.NET the same Long keyword is a 64-bit signed integer. If you want to translate the code, you have to replace the VB6 Long's with VB.NET Integer's. This is the biggest reason why people get this error message when using code they don't understand. Also, any structures must be passed as an actual structure, not a Long or Integer.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          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