blob stream to .net *.dll

chrido
Member Posts: 12
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:
Has anybody had similar problems and how did you solve them?
greetings chris
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
0
Comments
-
Are you getting an error?
I know streaming out of Navision the receiver needs to be IStream Persistent.
T0 -
That's the interface:
Boolean testStream([In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_STREAM)] Stream Items);
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?0 -
Now I changed the interface once more to:
Boolean testStream([In, MarshalAs(UnmanagedType.AsAny)] object Items);
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, chris0 -
hi 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.0 -
MSDN says:
UCOMIStream Interface
NOTE: This interface is now obsolete.
Use IStream instead.0 -
YES!!!! \:D/ \:D/ \:D/ \:D/ \:D/0
-
=D> =D>
Thanks!0 -
BlackTiger wrote:Ok. Posted to "Downloads".
link? I cannot see the download :-k0 -
ah ok :!:
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:0 -
wakestar wrote:ah ok :!:
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>0 -
anyone knows how to send the stream back to navision?
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...."0 -
I haven't tried it already, but maybe it is possible to pass a XMLDOMNode backto navision? Because it is possible to hand over a Com Class from nav to .net 2.0 like XMLDOMNode. Just call the method with the Com Class as Parameter.
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 navisionCurrently i feel like a setrange
0 -
BlackTiger wrote:But you have to switch streams.
you mean in c#, right?
some sample code would be great!0 -
Has someone found a solution to pass back a stream to navision yet?
regards
tobias0 -
You just have to support the IStream.Read method in your COM control.
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();This isn't a signature, I type this at the bottom of every message0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions