Visit Gigasoft's Web Site
 ProEssentials v9 Help

SaveToStream OCX Method

Scope All ProEssentials OCX Interfaces

 

SaveToStream() As Variant

 

The SaveToStream method is used primarily within an ActiveServerPage to produce a binary object file which is intended to be loaded via the LoadFromURL method. This enables client-side code to update a client-side ActiveX with data from the server.

 

Comments

See Also: SerializeToStream, JPEGToStream, PNGToStream, OCX Methods.

 

HTML / ASP Example

The following is an example of using SaveToStream. The example contains two parts, the first part is an HTML page that includes an object tag and vbscript that references a ASP page, the second part contains the ASP page.

 

Part1: HTML page references ASP page containing SaveToStream.

 

<HTML>

<HEAD></HEAD>

<BODY>

 

<p>This is a graph object tag, CODEBASE allows online downloading.</p>

<object classid="clsid:C612BED1-4A73-456F-BAF7-5FF010070F7E"

ID=Pego1

CODEBASE="http://www.yourserver.com/pe4.cab"

WIDTH="500"

HEIGHT="500" VIEWASTEXT>

</object>

 

<SCRIPT LANGUAGE="VBScript">

Pego1.LoadFromURL("http://www.yourserver.com/BuildBinData.asp")

</SCRIPT>

 

</BODY>

</HTML>

 

Part2: Below is BuildBinData.asp page content.

 

<%

dim myobj

Set myobj = server.CreateObject("PEGOG.PegogCtrl.1")

myobj.MainTitle = "Hello Internet"

myobj.PrepareImages = True

myobj.Subsets = 4

myobj.Points = 12

 

dim i

dim j

for i = 0 to 3

for j = 0 to 11

myobj.YData(i,j) = 5 + Rnd(20)

next

next

 

Response.BinaryWrite (myobj.SaveToStream())

 

Set myobj = Nothing

%>