473,410 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

how to get a pointer to a Stream?

Hello @all,

can someone tell me how to get a pointer to a stream?
I need to pass the pointer to an API-Functioncall.

Thanks for any help!
Jun 27 '08 #1
4 1812
"Assido" <As****@discussions.microsoft.comschrieb
Hello @all,

can someone tell me how to get a pointer to a stream? I need to pass
the pointer to an API-Functioncall.
Does the API function know what a .Net IO.Stream is? Haven't had it at
all yet. Declaring the argument "byval bla as io.stream" and passing "x"
(x being declared As IO.Stream) would do the job. But I have doubts that
a stream is a stream.
Armin

Jun 27 '08 #2
"Assido" <As****@discussions.microsoft.comschrieb:
can someone tell me how to get a pointer to a stream?
I need to pass the pointer to an API-Functioncall.
Could you post the API function's prototype?

If you are referring to the file's handle, take a look at the 'FileStream'
object's 'Handle' property.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 27 '08 #3
Hello Herfried,

here is the API-Function:

Declare Function WrapCompressedRTFStream Lib "mapi32.dll" (ByRef
lpCompressedRTFStream As Long, ByVal ulFlags As Long, ByRef
lpUncompressedRTFStream As Long) As Long
"Herfried K. Wagner [MVP]" wrote:
"Assido" <As****@discussions.microsoft.comschrieb:
can someone tell me how to get a pointer to a stream?
I need to pass the pointer to an API-Functioncall.

Could you post the API function's prototype?

If you are referring to the file's handle, take a look at the 'FileStream'
object's 'Handle' property.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 27 '08 #4
"Assido" <As****@discussions.microsoft.comschrieb:
here is the API-Function:

Declare Function WrapCompressedRTFStream Lib "mapi32.dll" (ByRef
lpCompressedRTFStream As Long, ByVal ulFlags As Long, ByRef
lpUncompressedRTFStream As Long) As Long
You may want to wrap the stream into a
'System.Runtime.InteropServices.ComTypes.IStream' and declare the parameter
as 'ByVal ... As IStream'. However, note that your declaration is not valid
for VB.NET.

Untested:

\\\
Imports System.Runtime.InteropServices
Imports System.Runtime.InteropServices.ComTypes
....
Public Declare Function WrapCompressedRTFStream Lib "mapi32.dll" ( _
ByVal lpCompressedRTFStream As IStream, _
ByVal ulflags As UInt32, _
<Out()ByVal lpUncompressedRTFStream As IStream _
) As IntPtr
///

Maybe you have to specify additional marshalling attributes.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Roger That | last post by:
Hi, I am trying to use the function "CreateStreamOnHGlobal" from python code (I need to pass an IStream object to MSXML, like I do in C++ code). I was able to retrieve a pointer on the IStream...
37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
14
by: Markus Dehmann | last post by:
The following if condition if((stream = fmemopen((void*)str, strlen(str), "r")) == NULL){ // ... } gives me a warning: assignment makes pointer from integer without a cast But only when I...
11
by: hilz | last post by:
Hi all: I have a FILE pointer that points to a file on disk (not any other io stream). is there a way to get the filename of that FILE? i thought it would be the _tmpfname part of the struct, but...
8
by: TJ | last post by:
I need to be able to pass a pointer to a (managed code) Stream object to a COM method so it can serialize its data into the stream. I have a C# application that makes uses of Randolf Duke's...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
1
by: Gary Wessle | last post by:
Hi I am trying to establish an output stream pointer to append things to a file as follows, is this correct? thanks class A{ ofstream ofs;
1
by: =?Utf-8?B?QXNzaWRv?= | last post by:
Hello @all, can someone tell me how to get a pointer to a stream? I need to pass the pointeraddress to an API-Functioncall. Thanks for any help!
5
by: zeeshan708 | last post by:
What is the use of a void* pointer? It points to a thing that is void ? So does that mean it is undefined or what? and also if someone can guide me on the following? from Dietel fiftth...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.