Stream into .NET Component

pijnappel
pijnappel Member Posts: 6
Hi,

I'm trying to read a from a BLOB through Navision streams and
give the stream to my .NET Interop component as a parameter.

I saw Navisions streams are compatible to the COM VT_STREAM type
but i had no luck by handling this type in C# :roll:

Is there any solution to handle Navision streams in a automation component? What I need is the BLOB e.g. as byte-array.

Thanks
Timo

Comments

  • DenSter
    DenSter Member Posts: 8,307
    I believe that you can 'translate' a BLOB into an outstream, and you can pick apart an oustream into a byte array in C#.
  • pijnappel
    pijnappel Member Posts: 6
    I can really get the Blob into an OutStream, but my problem is to find the
    right way to read it in c#. Which type is needed to take the Navision Outstream?

    When I set the parameter Type to byte[] it is translated to a SAFEARRAY
    type in COM. After filling this parameter with my OutStream Navision Compiles
    the object but shows an error when I try to run it, saying Navision can
    only handle the following Types VT_...blabla
  • DenSter
    DenSter Member Posts: 8,307
    I don't know what type the outstream maps to. I do know that you can use the IDispatch object in C#, which maps to a message object in Navision. I'd have to dig in my projects to find an example for you, and that may take some time.
  • schind
    schind Member Posts: 1
    Hi,

    have the same problem. I try to offer the IStream-Handle of my C#.Net Apps
    via COM to Navision. So I would like to get/set the content of a blob. But Navision only accept trival datatypes ...

    Got anyone a solution?