473,554 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(Ap pID)
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 3059
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(Ap pID)
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(Ap pID)
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.CreateOb ject("Something .IStream") or
Set MyStream = Server.CreateOb ject("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.Binary Write(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.CreateOb ject("Something .IStream") or
Set MyStream = Server.CreateOb ject("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.Binary Write(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" <gliknesATgloba lDASHsatcomDOTc om> 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(Ap pID)
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.CreateOb ject("Something .IStream") or
Set MyStream = Server.CreateOb ject("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.Binary Write(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3720
by: Thomas Matthews | last post by:
Hi, In some threads, some people mentioned that variable initialization is best performed in an initialization list. Is there a way to initialize a variable from an istream in an initialization list? Example: class My_Class {
3
2309
by: matthurne | last post by:
I'm doing a chapter 12 exercise from Accelerated C++ ... writing a string-like class which stores its data in a low-level way. My class, called Str, uses a char array and length variable. I've gotten everything working that I want working so far, except for std::istream& operator>>(std::istream&, Str&) The way my Str class manages...
13
3719
by: Randy | last post by:
Is there any way to do this? I've tried tellg() followed by seekg(), inserting the stream buffer to an ostringstream (ala os << is.rdbuf()), read(), and having no luck. The problem is, all of these methods EXTRACT the data at one point or another. The other problem is there appears to be NO WAY to get at the actual buffer pointer (char*) of...
5
2361
by: Jim Langston | last post by:
In one of my files I am outputting the value of a char into a human readable file. That is, char a = 123; std::ofstream CharFile( ("Players\\" + Name + ".char").c_str()); if ( CharFile.is_open() ) CharFile << (int) a; So the file has the character a stored as "123". That was the easy part, now comes the fun of reading it back into the...
13
10965
by: Gianni Mariani | last post by:
What I would like to do is read bytes from a stream, any number and any time. I would like it to wait until there are any bytes to read. I want the exact same functionality as cstdio's "fread" but in a std::istream. It appeared at first that "readsome" would do exactly what I wanted but it appears not to work very well at all (at least...
3
3372
by: KWienhold | last post by:
I'm currently writing an application (using Visual Studio 2003 SP1 and C#) that stores files and additional information in a single compound file using IStorage/IStream. Since files in a compound file aren't really useful to a user, I use the IStream::Read function together with a StreamWriter to extract single files from my compound...
2
4412
by: Colonel | last post by:
It seems that the problems have something to do with the overloading of istream operator ">>", but I just can't find the exact problem. // the declaration friend std::istream & operator>(std::istream & in, const Complex & a); // the methods correspond to the friend std::istream & operator>(std::istream & in, const Complex & a) {...
3
4541
by: Kourosh | last post by:
Hi all, I'm trying to call a COM function from C# The function gets a paramter of type IStream in C++. I've found the type System.Runtime.InteropServices.ComTypes.IStream, however I'm not sure how to create an instance of it to pass as the parameter. Anyone can tell me what to do? i dont know what to pass in as the parameter, because I'm not...
4
8079
by: Ralf | last post by:
Hallo, I'm trying to call a COM function from C#. The function has a parameter from the type array of IStream* (IStream**). The COM component (out-proc-server (.exe)) has the following code: (C++) STDMETHODIMP CIntf::SendFiles(int noOfStreams, IUnknown** dataStreams) {
0
2730
by: admb600 | last post by:
I wouldn't normally beg but my dissertation is due in, in a couple of weeks and I am in way over my head here.. Fixing this issue will make or break the project and my degree.. The goal is to extract the raw html from Internet Explorer using a BHO. When accessing the HTML via the mshtml.HTMLDocument (DOM) object you get a version of the HTML...
0
7612
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8053
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7576
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3583
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3564
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1147
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.