HighTechTalks DotNet Forums  

IPersistStreamInit

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss IPersistStreamInit in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?RG91Z2xhc1dvb2Rz?=
 
Posts: n/a

Default IPersistStreamInit - 08-14-2007 , 12:12 AM






I am accessing a COM object from C#. The COM object has a IPersistStreamInit
interface which I want to use.

Is the IPersistStreamInit defined in the .NET Framework? I couldn't find it
in system.runtime.interopservices. I have searched and found C# code that
has code like

Interop.IPersistStreamInit psi =
(Interop.IPersistStreamInit)_site.MSHTMLDocument;

http://www.koders.com/csharp/fid3C15...sistStreamInit

But I cannot work out where IPersistStreamInit is defined.

Can anyone point direct me out of this maze?
--
Douglas Woods

Reply With Quote
  #2  
Old   
mehr13@hotmail.com
 
Posts: n/a

Default Re: IPersistStreamInit - 08-15-2007 , 07:53 PM






On Aug 13, 8:12 pm, DouglasWoods
<DouglasWo... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I am accessing a COM object from C#. The COM object has a IPersistStreamInit
interface which I want to use.

Is the IPersistStreamInit defined in the .NET Framework? I couldn't find it
in system.runtime.interopservices. I have searched and found C# code that
has code like

Interop.IPersistStreamInit psi =
(Interop.IPersistStreamInit)_site.MSHTMLDocument;

http://www.koders.com/csharp/fid3C15...8187BCEFCEF0F3...

But I cannot work out where IPersistStreamInit is defined.

Can anyone point direct me out of this maze?
--
Douglas Woods

//MIDL_INTERFACE("7FD52380-4E07-101B-AE2D-08002B2EC713")
//IPersistStreamInit : public IPersist
//{
//public:
// virtual HRESULT STDMETHODCALLTYPE IsDirty( void) = 0;

// virtual HRESULT STDMETHODCALLTYPE Load(
// /* [in] */ LPSTREAM pStm) = 0;

// virtual HRESULT STDMETHODCALLTYPE Save(
// /* [in] */ LPSTREAM pStm,
// /* [in] */ BOOL fClearDirty) = 0;

// virtual HRESULT STDMETHODCALLTYPE GetSizeMax(
// /* [out] */ ULARGE_INTEGER *pCbSize) = 0;

// virtual HRESULT STDMETHODCALLTYPE InitNew( void) = 0;

//};

[ComVisible(true), ComImport(),
Guid("7FD52380-4E07-101B-AE2D-08002B2EC713"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceI sIUnknown)]
public interface IPersistStreamInit
{
void GetClassID(
[In, Out] ref Guid pClassID);

[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int IsDirty();

[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int Load(
[In, MarshalAs(UnmanagedType.Interface)]
System.Runtime.InteropServices.ComTypes.IStream pstm);

[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int Save(
[In, MarshalAs(UnmanagedType.Interface)]
System.Runtime.InteropServices.ComTypes.IStream pstm,
[In, MarshalAs(UnmanagedType.Bool)] bool fClearDirty);

void GetSizeMax(
[Out, MarshalAs(UnmanagedType.LPArray)] long pcbSize);

[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int InitNew();
}



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.