DotNet MemoryStream
                
                    mik                
                
                    Member Posts: 79                
            
                        
            
                    Hi,
I am just working on an external component and need to pass MemoryStreams to this .dll.
I found the following information for this topic.
http://kauffmann.nl/index.php/2012/04/04/binary-data-with-nav-web-service/
In this example you can see that he is using the command
I have atm the problem, that I can use this because of following error.
](*,)
Every DotNet Global is running on Client ("yes")
I'm using a Three-Tier Environment. Version: 7.10.36.366
greetings mik
                I am just working on an external component and need to pass MemoryStreams to this .dll.
I found the following information for this topic.
http://kauffmann.nl/index.php/2012/04/04/binary-data-with-nav-web-service/
In this example you can see that he is using the command
COPYSTREAM(MemoryStream,InStream);
I have atm the problem, that I can use this because of following error.
](*,)
Unable to convert from Microsoft.Dynamics.Nav.Runtime.NavDotNet to Microsoft.Dynamics.Nav.Runtime.NavOutStream.
Every DotNet Global is running on Client ("yes")
I'm using a Three-Tier Environment. Version: 7.10.36.366
greetings mik
With kind regards
mik
0                
            Answers
- 
            Hi,
I think I just found the solution after the longest 4 hours of my life. \:D/
I did the following....Name DataType Subtype Length AdvancedPDF DotNet mpAdvancedPDF.AdvPDF.'mpAdvancedPDF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e520dfe28c1ca5b5' MemoryStream DotNet System.IO.MemoryStream.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Stream DotNet System.IO.Stream.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' InStr InStream MemoryStream := MemoryStream.MemoryStream; Document.CALCFIELDS(BlobField); IF Document.BlobField.HASVALUE THEN BEGIN Document.BlobField.CREATEINSTREAM(InStr); Stream := InStr; Stream.CopyTo(MemoryStream); Message(Format(MemoryStream.Length())); END;
greetings mik
With kind regards
mik0 - 
            Was trying also, but method CopyTo does not exist on a system.io.stream???
How did you managed compiling that code?0 - 
            In this stackoverflow post it is said that the CopyTo() method has been implemented since .NET 4 but Mik gives a list of .net vars using version 2, maybe his code uses version 4 and he wrote version 2 on mibuso ?0
 
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
 - 323 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