Pass object from webserver to client
Posted
by user362914
on Stack Overflow
See other posts from Stack Overflow
or by user362914
Published on 2010-06-09T21:50:41Z
Indexed on
2010/06/09
21:52 UTC
Read the original article
Hit count: 166
I developed a C# web application that calls a web-service which returns a base64 encoded array (PDF file). I then convert that array into a UCOMIStream object (I know it is obsolete, but the DLL that I am using requires it as a parameter). I use the following code to do the conversion which works perfectly. I can pass this object to the DLL so that I can print the PDF.
This works great on the Webserver, but the requirement is to print it locally.
Byte[] bBuffer = statementOut.statementcycle.statementdata.content;
int size = bBuffer.Length;
IntPtr mem = Marshal.AllocHGlobal(size);
Marshal.Copy(bBuffer, 0, mem, size);
// Create an OLE Stream object.
System.Runtime.InteropServices.UCOMIStream str; //obsolete but the createstreamonhglobal outputs it
CreateStreamOnHGlobal(mem, true, out str);
The DLL resides on the client so I am able to use ActiveX to create the object using javascript and/or VBscript;however, I have not been able to figure out how to get the stream object to the client to pass to the DLL.
How can this be achieved?
© Stack Overflow or respective owner