469,352 Members | 2,214 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

IStream

Hi,

I am trying to access COM component - method that takes a IStream (ByRef)
parameter
from ASP (Not ASP.NET).

So far I have had no luck and google drowns my search with ASP.NET
examples...

I mange to create the object and call methods that returns strings (BSTR)
like this

Dim Svr
Set Svr = CreateObject(AppID)
Response.write(Svr.Method1)

The second method I need to call takes two parameters:

Method2(ID:Int, ByRef Stream:IStream)

Can anyone give me some hints on how to call this method from ASP?
Thx in advance
Gunnar
May 29 '06 #1
5 2888
Gunnar Liknes wrote:
Hi,

I am trying to access COM component - method that takes a IStream
(ByRef) parameter
from ASP (Not ASP.NET).

So far I have had no luck and google drowns my search with ASP.NET
examples...

I mange to create the object and call methods that returns strings
(BSTR) like this

Dim Svr
Set Svr = CreateObject(AppID)
Response.write(Svr.Method1)

The second method I need to call takes two parameters:

Method2(ID:Int, ByRef Stream:IStream)

Can anyone give me some hints on how to call this method from ASP?

http://support.microsoft.com/default...b;EN-US;244012
http://support.microsoft.com/default...b;EN-US;197956

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 29 '06 #2

Gunnar Liknes wrote:
Hi,

I am trying to access COM component - method that takes a IStream (ByRef)
parameter
from ASP (Not ASP.NET).

So far I have had no luck and google drowns my search with ASP.NET
examples...


Append your search expression with -net. It turns the torrent of
dotnet results into a trickle.

--
Mike Brind

May 29 '06 #3
"Bob Barrows [MVP]" wrote:
Gunnar Liknes wrote:

I am trying to access COM component - method that takes a IStream
(ByRef) parameter
from ASP (Not ASP.NET).

So far I have had no luck and google drowns my search with ASP.NET
examples...

I mange to create the object and call methods that returns strings
(BSTR) like this

Dim Svr
Set Svr = CreateObject(AppID)
Response.write(Svr.Method1)

The second method I need to call takes two parameters:

Method2(ID:Int, ByRef Stream:IStream)

Can anyone give me some hints on how to call this method from ASP?

http://support.microsoft.com/default...b;EN-US;244012
http://support.microsoft.com/default...b;EN-US;197956


Thank you for a quick response:-)

I think I use the correct calling convention now, however my problem is (I
think)
that I cant figure out how to create the IStream Interface.

Do I have to use CreateObject for that?

I was thinkning about somethnig like:

Dim MyStream
Set MyStream = Server.CreateObject("Something.IStream") or
Set MyStream = Server.CreateObject("Something.MemoryStream")

and then

Svr.GePicture (1), MyStream
' The second parameter is actually IUnknown ** But the implementation uses
'QueryInterface to obtain a IStream interface from it.
Response.BinaryWrite(MyStream, MyStream.Size)

Am I near something here?

Gunnar
May 29 '06 #4
Gunnar Liknes wrote:
http://support.microsoft.com/default...b;EN-US;244012
http://support.microsoft.com/default...b;EN-US;197956


Thank you for a quick response:-)

I think I use the correct calling convention now, however my problem
is (I think)
that I cant figure out how to create the IStream Interface.

Do I have to use CreateObject for that?

I was thinkning about somethnig like:

Dim MyStream
Set MyStream = Server.CreateObject("Something.IStream") or
Set MyStream = Server.CreateObject("Something.MemoryStream")

and then

Svr.GePicture (1), MyStream
' The second parameter is actually IUnknown ** But the implementation
uses 'QueryInterface to obtain a IStream interface from it.
Response.BinaryWrite(MyStream, MyStream.Size)

I don't believe interfaces are usable from script. you will need to create
an intermediate object, either in VB or C++

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 29 '06 #5

"Gunnar Liknes" <gliknesATglobalDASHsatcomDOTcom> wrote in message
news:44********@news.broadpark.no...
"Bob Barrows [MVP]" wrote:
Gunnar Liknes wrote:
I am trying to access COM component - method that takes a IStream
(ByRef) parameter
from ASP (Not ASP.NET).

So far I have had no luck and google drowns my search with ASP.NET
examples...

I mange to create the object and call methods that returns strings
(BSTR) like this

Dim Svr
Set Svr = CreateObject(AppID)
Response.write(Svr.Method1)

The second method I need to call takes two parameters:

Method2(ID:Int, ByRef Stream:IStream)

Can anyone give me some hints on how to call this method from ASP?

http://support.microsoft.com/default...b;EN-US;244012
http://support.microsoft.com/default...b;EN-US;197956


Thank you for a quick response:-)

I think I use the correct calling convention now, however my problem is (I
think)
that I cant figure out how to create the IStream Interface.

Do I have to use CreateObject for that?

I was thinkning about somethnig like:

Dim MyStream
Set MyStream = Server.CreateObject("Something.IStream") or
Set MyStream = Server.CreateObject("Something.MemoryStream")

and then

Svr.GePicture (1), MyStream
' The second parameter is actually IUnknown ** But the implementation uses
'QueryInterface to obtain a IStream interface from it.
Response.BinaryWrite(MyStream, MyStream.Size)

Am I near something here?


You are. The thing your missing is that Response _is_ an implementation of
IStream. So what you want is this:-

Svr.GePicture(1), Response

Just don't forget to set the ContentType property to the correct mimetype
for the image format being sent.

Gunnar

May 30 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Thomas Matthews | last post: by
13 posts views Thread by Gianni Mariani | last post: by
3 posts views Thread by KWienhold | last post: by
2 posts views Thread by Colonel | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.