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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. help me: 'XPExplorerBar'

help me: 'XPExplorerBar'

Scheduled Pinned Locked Moved C#
helpdata-structuresregex
6 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.
  • D Offline
    D Offline
    dangquoctrang
    wrote on last edited by
    #1

    Whenever I wana use XPExplorerBar.dll in my projects, I have this problem. When I press F5, the project returns to code editor and a window alerts me this: A call to PInvoke function 'XPExplorerBar! XPExplorerBar NativeMethods:: LoadBitmap' 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. [DllImport("User32.dll")] public static extern IntPtr LoadBitmap(IntPtr hInstance, long lpBitmapName); and must be changed to this : DllImport("User32.dll")] public static extern IntPtr LoadBitmap(IntPtr hInstance, int lpBitmapName); But I don't kwon

    L J 2 Replies Last reply
    0
    • D dangquoctrang

      Whenever I wana use XPExplorerBar.dll in my projects, I have this problem. When I press F5, the project returns to code editor and a window alerts me this: A call to PInvoke function 'XPExplorerBar! XPExplorerBar NativeMethods:: LoadBitmap' 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. [DllImport("User32.dll")] public static extern IntPtr LoadBitmap(IntPtr hInstance, long lpBitmapName); and must be changed to this : DllImport("User32.dll")] public static extern IntPtr LoadBitmap(IntPtr hInstance, int lpBitmapName); But I don't kwon

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, your prototype is wrong: http://msdn.microsoft.com/en-us/library/ms532309(VS.85).aspx[^] the second parameter needs to be simply a C# string. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Voting for dummies? No thanks. X|


      J 1 Reply Last reply
      0
      • D dangquoctrang

        Whenever I wana use XPExplorerBar.dll in my projects, I have this problem. When I press F5, the project returns to code editor and a window alerts me this: A call to PInvoke function 'XPExplorerBar! XPExplorerBar NativeMethods:: LoadBitmap' 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. [DllImport("User32.dll")] public static extern IntPtr LoadBitmap(IntPtr hInstance, long lpBitmapName); and must be changed to this : DllImport("User32.dll")] public static extern IntPtr LoadBitmap(IntPtr hInstance, int lpBitmapName); But I don't kwon

        J Offline
        J Offline
        Judah Gabriel Himango
        wrote on last edited by
        #3

        This was discussed and fixed[^] in the comments to the XPExplorerBar article.

        Life, family, faith: Give me a visit. From my latest post: "We are Christian, resistance is futile. Your Jewish traits will be assimilated into the Church collective." Judah Himango

        1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, your prototype is wrong: http://msdn.microsoft.com/en-us/library/ms532309(VS.85).aspx[^] the second parameter needs to be simply a C# string. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          Voting for dummies? No thanks. X|


          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          Actually, it works if the long is changed to an int. (C++ long == C# int). I'm not sure why it works with this modification, since it does appear the unmanaged method takes a string, not an int. :confused: *edit* Ah, according to MSDN,

          Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can be used to create this value.

          That's why passing in an int will work.

          Life, family, faith: Give me a visit. From my latest post: "We are Christian, resistance is futile. Your Jewish traits will be assimilated into the Church collective." Judah Himango

          L 1 Reply Last reply
          0
          • J Judah Gabriel Himango

            Actually, it works if the long is changed to an int. (C++ long == C# int). I'm not sure why it works with this modification, since it does appear the unmanaged method takes a string, not an int. :confused: *edit* Ah, according to MSDN,

            Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can be used to create this value.

            That's why passing in an int will work.

            Life, family, faith: Give me a visit. From my latest post: "We are Christian, resistance is futile. Your Jewish traits will be assimilated into the Church collective." Judah Himango

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Wow. Strictly speaking, this still seems incorrect. If what gets passed is a pointer, it should take 4 or 8 bytes depending on Win32/Win64. So when not a string, then an IntPtr should be used, don't you think? :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            Voting for dummies? No thanks. X|


            J 1 Reply Last reply
            0
            • L Luc Pattyn

              Wow. Strictly speaking, this still seems incorrect. If what gets passed is a pointer, it should take 4 or 8 bytes depending on Win32/Win64. So when not a string, then an IntPtr should be used, don't you think? :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              Voting for dummies? No thanks. X|


              J Offline
              J Offline
              Judah Gabriel Himango
              wrote on last edited by
              #6

              Yeah, if it's taking a pointer, then yes, an IntPtr should be used rather than an int. However, while I'm not privvy on all the unmanaged lingo, it's not clear from the documentation that it is a pointer. It seems the integer is simply an identifier of a resource, not a pointer to an integer.

              Tech, life, family, faith: Give me a visit. I'm currently blogging about: Upon this disciple I'll build my new religion? The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

              modified on Friday, July 18, 2008 1:51 PM

              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