DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 13 Aug 2007 21:12:03 -0700,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    DouglasWoods
          2    Mattias Sjgren
          3    unknown


IPersistStreamInit   
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/fid3C1586372712141DB6359918187BCEFCEF0F3F97.aspx?s=IPersistStreamInit

But I cannot work out where IPersistStreamInit is defined.

Can anyone point direct me out of this maze?
-- 
Douglas  Woods
Date:Mon, 13 Aug 2007 21:12:03 -0700   Author:  

Re: IPersistStreamInit   

>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


No it isn't. You have to define it yourself. You can start with
IPersistStream from here

http://www.pinvoke.net/default.aspx/Interfaces/IPersistStream.html

and then add the IPersistStreamInit methods.


Mattias

-- 
Mattias Sjgren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Date:Tue, 14 Aug 2007 08:58:49 +0200   Author:  

Re: IPersistStreamInit   
On Aug 13, 8:12 pm, DouglasWoods
 wrote:

> 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/fid3C1586372712141DB6359918187BCEFCEF0F3...
>
> 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.InterfaceIsIUnknown)]
    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();
    }
Date:Wed, 15 Aug 2007 16:53:54 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us