Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than ole32, prefix the name with the module name and a period.
StgOpenStorage (ole32)
.
C# Signature:
/// <summary>Opens a compound document file and represents it as an IStorage object</summary>
/// <remarks>Use on Windows 2000 and earlier</remarks>
/// <param name="pwcsName">The path and filename of the file to open</param>
/// <param name="pstgPriority">Generally passed as null</param>
/// <param name="grfMode">Access Method</param>
/// <param name="snbExclude">Must be NULL</param>
/// <param name="reserved">Pass as zero (0)</param>
/// <param name="ppstgOpen">out IStorage</param>
/// <returns>int HRESULT</returns>
[DllImport("ole32.dll")]
PreserveSig // To preserve the HRESULT as the int return value
internal static extern int StgOpenStorage(
[MarshalAs(UnmanagedType.LPWStr)] string pwcsName
, IStorage pstgPriority
, STGM grfMode // Access Method (uint)
, IntPtr snbExclude // Must be NULL
, uint reserved // Reserved
, out IStorage ppstgOpen); // Returned Storage
int hResult = StgOpenStorage(pathAndFilename, null, STGM.READ_ONLY, IntPtr.Zero, 0, out storage);
// Then one can use the EnumElements method of the IStorage interface to enum the properties of the OLE2 storage.
Alternative Managed API:
Do you know one? Please contribute it!
TODO - a short description
10/25/2015 7:07:57 AM - erlichmen@_NOSPAM_gmail.com-193.27.93.1
TODO - a short description
10/25/2015 7:07:57 AM - erlichmen@_NOSPAM_gmail.com-193.27.93.1
TODO - a short description
10/19/2009 7:36:00 AM - anonymous
Click to read this page
5/16/2017 3:40:12 AM - anonymous
TODO - a short description
10/25/2015 7:07:57 AM - erlichmen@_NOSPAM_gmail.com-193.27.93.1
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
TODO - a short description
10/25/2015 7:07:57 AM - erlichmen@_NOSPAM_gmail.com-193.27.93.1
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).