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. C#
  4. ASCII LpSTR?

ASCII LpSTR?

Scheduled Pinned Locked Moved C#
csharphelpquestion
2 Posts 2 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.
  • R Offline
    R Offline
    Russell Jones
    wrote on last edited by
    #1

    I'm trying to make a call into a compression dll This is declared like this in VB6: Private Declare Function compress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long Private Declare Function uncompress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long I've added the following to a c# class [DllImport("compression.dll")] public static extern int uncompress(ref byte[] inputBuffer, ref int inputLength, ref byte[] outputBuffer, int OutputLength); [DllImport("compression.dll")] public static extern int compress( [MarshalAs(UnmanagedType.LPStr)] StringBuilder inputBuffer,ref int inputLength, [MarshalAs(UnmanagedType.LPStr)] StringBuilder outputBuffer, int OutputLength); If i call the compress method using c# and decompress using c# this works fine. The problem arises when i try to compress in c# and decompress in vb6 or vice versa. Is there a back compatability mode for string functions like this? Thanks in advance Russell

    D 1 Reply Last reply
    0
    • R Russell Jones

      I'm trying to make a call into a compression dll This is declared like this in VB6: Private Declare Function compress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long Private Declare Function uncompress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long I've added the following to a c# class [DllImport("compression.dll")] public static extern int uncompress(ref byte[] inputBuffer, ref int inputLength, ref byte[] outputBuffer, int OutputLength); [DllImport("compression.dll")] public static extern int compress( [MarshalAs(UnmanagedType.LPStr)] StringBuilder inputBuffer,ref int inputLength, [MarshalAs(UnmanagedType.LPStr)] StringBuilder outputBuffer, int OutputLength); If i call the compress method using c# and decompress using c# this works fine. The problem arises when i try to compress in c# and decompress in vb6 or vice versa. Is there a back compatability mode for string functions like this? Thanks in advance Russell

      D Offline
      D Offline
      Dave Herren
      wrote on last edited by
      #2

      Russell Jones wrote:

      The problem arises

      What is the problem... an error message, invalid data, what? Please provide a little detail.

      topcoderjax - Remember, Google is your friend. Try this Custom Google Code Search

      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