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 / C++ / MFC
  4. SAFEARRAY [modified]

SAFEARRAY [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++comsysadmindata-structuresquestion
5 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.
  • V Offline
    V Offline
    Vijjuuu
    wrote on last edited by
    #1

    Hi All, How can i pass , BYTE array parameter from VC++ 6.0 to OLE Server to SAFEARRAY Argument. Regards Vj

    modified on Thursday, November 27, 2008 5:43 AM

    R 1 Reply Last reply
    0
    • V Vijjuuu

      Hi All, How can i pass , BYTE array parameter from VC++ 6.0 to OLE Server to SAFEARRAY Argument. Regards Vj

      modified on Thursday, November 27, 2008 5:43 AM

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      How is the function you're calling declared? [modified] I mean the function in the server. What kind of argument are you supposed to pass, a VARIANT that contains a SafeArray? [/modified]

      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      V 1 Reply Last reply
      0
      • R Roger Stoltz

        How is the function you're calling declared? [modified] I mean the function in the server. What kind of argument are you supposed to pass, a VARIANT that contains a SafeArray? [/modified]

        "It's supposed to be hard, otherwise anybody could do it!" - selfquote
        "High speed never compensates for wrong direction!" - unknown

        V Offline
        V Offline
        Vijjuuu
        wrote on last edited by
        #3

        Hi Roger, Thanks for you reply , i have written a dll in C#.net and using RegAsm i created a .tlb file and i am using those functions in VC++6.0 C# function void fun(byte[] input) which is conveted to void fun(SAFEARRAY *input) in .tlb file . now i dont know how to pass BYTE array to this fun function from VC++ 6.0

        R 1 Reply Last reply
        0
        • V Vijjuuu

          Hi Roger, Thanks for you reply , i have written a dll in C#.net and using RegAsm i created a .tlb file and i am using those functions in VC++6.0 C# function void fun(byte[] input) which is conveted to void fun(SAFEARRAY *input) in .tlb file . now i dont know how to pass BYTE array to this fun function from VC++ 6.0

          R Offline
          R Offline
          Roger Stoltz
          wrote on last edited by
          #4

          Ok, try the following:

          1. Create a SafeArray with a call to ::SafeArrayCreate() and set the VARTYPE parameter to VT_UI1.
          2. Get the data buffer of the SafeArray with a call to ::SafeArrayAccessData() and copy whatever data you'd like into the buffer.
          3. Release the bufer when you're done with it with a call to ::SafeArrayUnaccessData().
          4. Call the fun() function.

          Look the SafeArray functions up for information on how to call and use them. Begin at SafeArrayCreate[^].

          "It's supposed to be hard, otherwise anybody could do it!" - selfquote
          "High speed never compensates for wrong direction!" - unknown

          V 1 Reply Last reply
          0
          • R Roger Stoltz

            Ok, try the following:

            1. Create a SafeArray with a call to ::SafeArrayCreate() and set the VARTYPE parameter to VT_UI1.
            2. Get the data buffer of the SafeArray with a call to ::SafeArrayAccessData() and copy whatever data you'd like into the buffer.
            3. Release the bufer when you're done with it with a call to ::SafeArrayUnaccessData().
            4. Call the fun() function.

            Look the SafeArray functions up for information on how to call and use them. Begin at SafeArrayCreate[^].

            "It's supposed to be hard, otherwise anybody could do it!" - selfquote
            "High speed never compensates for wrong direction!" - unknown

            V Offline
            V Offline
            Vijjuuu
            wrote on last edited by
            #5

            Roger, Thank you so much for your time to reply it.

            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