Hello,
I like to stream out to a .net dll from a blob. Which type is used for this?
I've tried System.Runtime.InteropServices.ComTypes.UnmanagedType.SafeArray, System.IO.Stream, ... but they all didn't work.
In the C/SIDE documentation it is said that they use VT_STREAM, so i tried:
Stream testStream([In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_STREAM)] Stream Items);
But it also didn't work.
Has anybody had similar problems and how did you solve them?
greetings chris
Comments
I know streaming out of Navision the receiver needs to be IStream Persistent.
T
If you look in Navision in the C/AL Symbol Menu
[BOOL testStream :=] testStream(_STREAM Items)
And this results in this error Message if you try to save:
Type conversion is not possible because 1 of the operators contains an invalid type
Automation := OutStream
So I think _STREAM is incorrect. It should be VARIANT (like msxml.load)
can you give me a hint?
And in the Symbol Menu the types seem to fit:
[BOOL testStream :=] testStream(VARIANT Items)
So I get the Stream in .net as an object. But what do I do now to get the content? Because it's a Com Type I can't just cast it to a Stream.
greetings, chris
I'm also trying to pass a stream to a .net control. No luck yet. :roll:
I had the same results.
let us know when you have some interesting news.
UCOMIStream Interface
NOTE: This interface is now obsolete.
Use IStream instead.
Thanks!
link? I cannot see the download :-k
I have a strange error - message in german.
something like "error at the requisition of the type System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089."
:shock:
Problem solved! Stream is working now!
@ chrido & BlackTiger: Thanks a million! =D>
I'm trying it with passing the stream through an event but no luck yet....
"The stream is either out of scope or has not been initialized...."
I have already tried that during the lunch break, but not hard enough.
Regrettably I have no Windows computer around this weekend, only my freebsd machine, no navision
you mean in c#, right?
some sample code would be great!
regards
tobias
The way I have done it in the past is as follows.
In C# have a method like pubic MyIStream GetStream()
then in Navision have an InStream variable and do the following
MyInStream := MyControl.GetStream();