|
CreateStreamOnHGlobal
Returns an OLE-provided implementation of the IStream interface with the stream object stored in global memory.
HRESULT CreateStreamOnHGlobal(
HGLOBAL hGlobal,
| //Memory handle for the stream object
| BOOL fDeleteOnRelease,
| //Indicates whether to free memory when the object is released
| LPSTREAM * ppstm
| //Points to location for pointer to the new stream object
| );
|
|
Parameters
hGlobal
Contains the memory handle allocated by the GlobalAlloc function. The handle must be allocated as moveable and nondiscardable. If the
handle is to be shared between processes, it must also be allocated as shared.
New handles should be allocated with a size of zero. If hGlobal is NULL, the CreateStreamOnHGlobal function internally allocates a new shared memory block of size zero.
fDeleteOnRelease
Indicates whether the underlying handle for this stream object should be
automatically freed when the stream object is released.
ppstm
Points to the location where this method places a pointer to the new stream
object, that is, the new IStream instance. It cannot be NULL.
Return Values
S_OK
Indicates the stream object was created successfully.
E_OUTOFMEMORY
Indicates the stream could not be created due to lack of memory.
E_INVALIDARG
Indicates invalid value for one of the parameters.
Comments
This function creates a stream object in memory using the OLE-provided
implementation of the IStream interface. The returned stream object supports both reading and writing, is
not transacted, and does not support locking.
The initial contents of the stream are the current contents of the memory
block provided in the hGlobal parameter. If the hGlobal paramter is NULL, this function internally allocates memory.
The current contents of the memory block are undisturbed by the creation of
the new stream object. Thus, you can use this function to open an existing stream
in memory.
The initial size of the stream is the size of the memory handle returned by
the Win32 GlobalSize function. Because of rounding, this is not necessarily the same size that was
originally allocated for the handle. If the logical size of the stream is
important, you should follow the call to this function with a call to the IStream::SetSize method.
See Also
CreateStreamOnHGlobal, IStream::SetSize
GlobalSize in Win32
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|