473,765 Members | 1,869 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 3066
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
3731
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
2324
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 itself of course requires that the size of the char array to store is known when it is allocated. The...
13
3732
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 the characters in the stream. There is a way to get the streambuf object associated with the...
5
2370
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 char.
13
10999
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 with gcc!). When reading from a named pipe on gcc, it returns immediately - no errors, just...
3
3379
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 document. When I first tested these functions everything seemed to work fine (and basically, it does),...
2
4440
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) { std::cout << "real: ";
3
4552
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 sure how to create an instance of the "IStream" object in C#
4
8105
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
2742
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 that is different from what you see when you "right click --> view source". IE changes the code for...
0
10153
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9946
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8830
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7371
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.