File: Windows.Win32.IOleObject.g.cs
Project: src\src\System.Windows.Forms.Primitives\src\System.Windows.Forms.Primitives.csproj (System.Windows.Forms.Primitives)
// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
	namespace System.Ole
	{
		[Guid("00000112-0000-0000-C000-000000000046")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IOleObject
			:IVTable<IOleObject,IOleObject.Vtbl>,IComIID		{
			/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
			internal unsafe winmdroot.Foundation.HRESULT QueryInterface(in global::System.Guid riid, out void* ppvObject)
			{
				fixed (void** ppvObjectLocal = &ppvObject)
				{
					fixed (global::System.Guid* riidLocal = &riid)
					{
						winmdroot.Foundation.HRESULT __result = this.QueryInterface(riidLocal, ppvObjectLocal);
						return __result;
					}
				}
			}

			public unsafe winmdroot.Foundation.HRESULT QueryInterface(global::System.Guid* riid, void** ppvObject)
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleObject*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

			public uint AddRef()
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,uint>)lpVtbl[1])((IOleObject*)Unsafe.AsPointer(ref this));
			}

			public uint Release()
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,uint>)lpVtbl[2])((IOleObject*)Unsafe.AsPointer(ref this));
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetClientSite(IOleObject* pThis, winmdroot.System.Ole.IOleClientSite* pClientSite)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetClientSite(pClientSite);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Informs an embedded object of its display location, called a &quot;client site,&quot; within its container.</summary>
			/// <param name="pClientSite">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleclientsite">IOleClientSite</a> interface on the container application's client-site.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Within a compound document, each embedded object has its own client site - the place where it is displayed and through which it receives information about its storage, user interface, and other resources. <b>IOleObject::SetClientSite</b> is the only method enabling an embedded object to obtain a pointer to its client site. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> A container can notify an object of its client site either at the time the object is created or, subsequently, when the object is initialized. When creating or loading an object, a container may pass a client-site pointer (along with other arguments) to one of the following helper functions: <a href="https://docs.microsoft.com/windows/desktop/api/ole/nf-ole-olecreate">OleCreate</a>, <a href="https://docs.microsoft.com/windows/desktop/api/ole/nf-ole-olecreatefromfile">OleCreateFromFile</a>, <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olecreatefromdata">OleCreateFromData</a> or <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-oleload">OleLoad</a>. These helper functions load an object handler for the new object and call <b>IOleObject::SetClientSite</b> on the container's behalf before returning a pointer to the new object. Passing a client-site pointer informs the object handler that the client site is ready to process requests. If the client site is unlikely to be ready immediately after the handler is loaded, you may want your container to pass a <b>NULL</b> client-site pointer to the helper function. The <b>NULL</b> pointer says that no client site is available and thereby defers notifying the object handler of the client site until the object is initialized. In response, the helper function returns a pointer to the object, but upon receiving that pointer the container must call <b>IOleObject::SetClientSite</b> as part of initializing the new object. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Implementation consists simply of incrementing the reference count on, and storing, the pointer to the client site.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-setclientsite#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT SetClientSite(winmdroot.System.Ole.IOleClientSite* pClientSite)
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Ole.IOleClientSite* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleObject*)Unsafe.AsPointer(ref this), pClientSite);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetClientSite(IOleObject* pThis, winmdroot.System.Ole.IOleClientSite** ppClientSite)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetClientSite(ppClientSite);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves a pointer to an embedded object's client site.</summary>
			/// <param name="ppClientSite">Address of <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleclientsite">IOleClientSite</a> pointer variable that receives the interface pointer to the object's client site. If an object does not yet know its client site, or if an error has occurred, <i>ppClientSite</i> must be set to <b>NULL</b>. Each time an object receives a call to <b>IOleObject::GetClientSite</b>, it must increase the reference count on <i>ppClientSite</i>. It is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> when it is done with <i>ppClientSite</i>.</param>
			/// <returns>This method returns S_OK on success.</returns>
			/// <remarks>
			/// <para>Link clients most commonly call the <b>IOleObject::GetClientSite</b> method in conjunction with the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleclientsite-getcontainer">IOleClientSite::GetContainer</a> method to traverse a hierarchy of nested objects. A link client calls <b>IOleObject::GetClientSite</b> to get a pointer to the link source's client site. The client then calls <b>IOleClientSite::GetContainer</b> to get a pointer to the link source's container. Finally, the client calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q)">QueryInterface</a> to get <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleobject">IOleObject</a> and <b>IOleObject::GetClientSite</b> to get the container's client site within its container. By repeating this sequence of calls, the caller can eventually retrieve a pointer to the master container in which all the other objects are nested. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The returned client-site pointer will be <b>NULL</b> if an embedded object has not yet been informed of its client site. This will be the case with a newly loaded or created object when a container has passed a <b>NULL</b> client-site pointer to one of the object-creation helper functions but has not yet called <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-setclientsite">IOleObject::SetClientSite</a> as part of initializing the object.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-getclientsite#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetClientSite(winmdroot.System.Ole.IOleClientSite** ppClientSite)
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Ole.IOleClientSite** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleObject*)Unsafe.AsPointer(ref this), ppClientSite);
			}

			/// <inheritdoc cref="SetHostNames(winmdroot.Foundation.PCWSTR, winmdroot.Foundation.PCWSTR)"/>
			internal unsafe void SetHostNames(string szContainerApp, string szContainerObj)
			{
				fixed (char* szContainerObjLocal = szContainerObj)
				{
					fixed (char* szContainerAppLocal = szContainerApp)
					{
						this.SetHostNames(szContainerAppLocal, szContainerObjLocal);
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetHostNames(IOleObject* pThis, winmdroot.Foundation.PCWSTR szContainerApp, winmdroot.Foundation.PCWSTR szContainerObj)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetHostNames(szContainerApp, szContainerObj);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Provides an object with the names of its container application and the compound document in which it is embedded.</summary>
			/// <param name="szContainerApp">Pointer to the name of the container application in which the object is running.</param>
			/// <param name="szContainerObj">Pointer to the name of the compound document that contains the object. If you do not wish to display the name of the compound document, you can set this parameter to <b>NULL</b>.</param>
			/// <returns>This method returns S_OK on success.</returns>
			/// <remarks>
			/// <para><h3><a id="Notes_for_Callers"></a><a id="notes_for_callers"></a><a id="NOTES_FOR_CALLERS"></a>Notes for Callers</h3> Call <b>IOleObject::SetHostNames</b> only for embedded objects, because for linked objects, the link source provides its own separate editing window and title bar information. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> An object's application of <b>IOleObject::SetHostNames</b> should include whatever modifications to its user interface may be appropriate to an object's embedded state. Such modifications typically will include adding and removing menu commands and altering the text displayed in the title bar of the editing window. The complete window title for an embedded object in an SDI container application or an MDI application with a maximized child window should appear as follows:</para>
			/// <para></para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-sethostnames#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void SetHostNames(winmdroot.Foundation.PCWSTR szContainerApp, winmdroot.Foundation.PCWSTR szContainerObj)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleObject*)Unsafe.AsPointer(ref this), szContainerApp, szContainerObj).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Close(IOleObject* pThis, uint dwSaveOption)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Close(dwSaveOption);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Changes an embedded object from the running to the loaded state. Disconnects a linked object from its link source.</summary>
			/// <param name="dwSaveOption">
			/// <para>Indicates whether the object is to be saved as part of the transition to the loaded state. Valid values are taken from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-oleclose">OLECLOSE</a>. <div class="alert"><b>Note</b>  The OLE 2 user model recommends that object applications do not prompt users before saving linked or embedded objects, including those activated in place. This policy represents a change from the OLE 1 user model, in which object applications always prompt the user to decide whether to save changes.</div> <div> </div></para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-close#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> A container application calls <b>IOleObject::Close</b> when it wants to move the object from a running to a loaded state. Following such a call, the object still appears in its container but is not open for editing. Calling <b>IOleObject::Close</b> on an object that is loaded but not running has no effect. Closing a linked object simply means disconnecting it. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Upon receiving a call to <b>IOleObject::Close</b>, a running object should do the following: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-close#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void Close(uint dwSaveOption)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleObject*)Unsafe.AsPointer(ref this), dwSaveOption).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetMoniker(IOleObject* pThis, uint dwWhichMoniker, winmdroot.System.Com.IMoniker* pmk)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetMoniker(dwWhichMoniker, pmk);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Notifies an object of its container's moniker, the object's own moniker relative to the container, or the object's full moniker.</summary>
			/// <param name="dwWhichMoniker">The moniker is passed in <i>pmk</i>. Possible values are from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-olewhichmk">OLEWHICHMK</a>.</param>
			/// <param name="pmk">Pointer to where to return the moniker.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>A container that supports links to embedded objects must be able to inform an embedded object when its moniker has changed. Otherwise, subsequent attempts by link clients to bind to the object will fail. The <b>IOleObject::SetMoniker</b> method provides one way for a container to communicate this information. The container can pass either its own moniker, an object's moniker relative to the container, or an object's full moniker. In practice, if a container passes anything other than an object's full moniker, each object calls the container back to request assignment of the full moniker, which the object requires to register itself in the running object table. The moniker of an object relative to its container is stored by the object handler as part of the object's persistent state. The moniker of the object's container, however, must not be persistently stored inside the object because the container can be renamed at any time. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> A container calls <b>IOleObject::SetMoniker</b> when the container has been renamed, and the container's embedded objects currently or can potentially serve as link sources. Containers call SetMoniker mainly in the context of linking because an embedded object is already aware of its moniker. Even in the context of linking, calling this method is optional because objects can call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleclientsite-getmoniker">IOleClientSite::GetMoniker</a> to force assignment of a new moniker. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Upon receiving a call to <b>IOleObject::SetMoniker</b>, an object should register its full moniker in the running object table and send <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-iadvisesink-onrename">IAdviseSink::OnRename</a> notification to all advise sinks that exist for the object.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-setmoniker#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void SetMoniker(uint dwWhichMoniker, winmdroot.System.Com.IMoniker* pmk)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.System.Com.IMoniker* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleObject*)Unsafe.AsPointer(ref this), dwWhichMoniker, pmk).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetMoniker(IOleObject* pThis, uint dwAssign, uint dwWhichMoniker, winmdroot.System.Com.IMoniker** ppmk)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetMoniker(dwAssign, dwWhichMoniker, ppmk);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves an embedded object's moniker, which the caller can use to link to the object.</summary>
			/// <param name="dwAssign">
			/// <para>Determines how the moniker is assigned to the object. Depending on the value of <i>dwAssign</i>, <b>IOleObject::GetMoniker</b> does one of the following: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-getmoniker#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="dwWhichMoniker">Specifies the form of the moniker being requested. Possible values are taken from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-olewhichmk">OLEWHICHMK</a>.</param>
			/// <param name="ppmk">Address of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> pointer variable that receives the interface pointer to the object's moniker. If an error occurs, <i>ppmk</i> must be set to <b>NULL</b>. Each time an object receives a call to <b>IOleObject::GetMoniker</b>, it must increase the reference count on <i>ppmk</i>. It is the caller's responsibility to call Release when it is done with <i>ppmk</i>.</param>
			/// <returns>This method returns S_OK on success.</returns>
			/// <remarks>The <b>IOleObject::GetMoniker</b> method returns an object's moniker. Like <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-setmoniker">IOleObject::SetMoniker</a>, this method is important only in the context of managing links to embedded objects and even in that case is optional. A potential link client that requires an object's moniker to bind to the object can call this method to obtain that moniker. The default implementation of <b>IOleObject::GetMoniker</b> calls the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleclientsite-getmoniker">IOleClientSite::GetMoniker</a>, returning E_UNEXPECTED if the object is not running or does not have a valid pointer to a client site.</remarks>
			public unsafe void GetMoniker(uint dwAssign, uint dwWhichMoniker, winmdroot.System.Com.IMoniker** ppmk)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,uint ,uint ,winmdroot.System.Com.IMoniker** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleObject*)Unsafe.AsPointer(ref this), dwAssign, dwWhichMoniker, ppmk).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT InitFromData(IOleObject* pThis, winmdroot.System.Com.IDataObject* pDataObject, winmdroot.Foundation.BOOL fCreation, uint dwReserved)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.InitFromData(pDataObject, fCreation, dwReserved);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Initializes a newly created object with data from a specified data object, which can reside either in the same container or on the Clipboard.</summary>
			/// <param name="pDataObject">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a> interface on the data object from which the initialization data is to be obtained. This parameter can be <b>NULL</b>, which indicates that the caller wants to know if it is worthwhile trying to send data; that is, whether the container is capable of initializing an object from data passed to it. The data object to be passed can be based on either the current selection within the container document or on data transferred to the container from an external source.</param>
			/// <param name="fCreation"><b>TRUE</b> indicates the container is inserting a new object inside itself and initializing that object with data from the current selection; <b>FALSE</b> indicates a more general programmatic data transfer, most likely from a source other than the current selection.</param>
			/// <param name="dwReserved">This parameter is reserved and must be zero.</param>
			/// <returns>
			/// <para>This method returns S_OK if <i>pDataObject</i> is not <b>NULL</b>, the object successfully attempted to initialize itself from the provided data; if <i>pDataObject</i> is <b>NULL</b>, the object is able to attempt a successful initialization.. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>This method enables a container document to insert within itself a new object whose content is based on a current data selection within the container. For example, a spreadsheet document may want to create a graph object based on data in a selected range of cells. Using this method, a container can also replace the contents of an embedded object with data transferred from another source. This provides a convenient way of updating an embedded object. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Following initialization, the container should call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-getmiscstatus">IOleObject::GetMiscStatus</a> to check the value of the OLEMISC_INSERTNOTREPLACE bit. If the bit is on, the new object inserts itself following the selected data. If the bit is off, the new object replaces the selected data. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> A container specifies whether to base a new object on the current selection by passing either <b>TRUE</b> or <b>FALSE</b> to the <i>fCreation</i> parameter. If <i>fCreation</i> is <b>TRUE</b>, the container is attempting to create a new instance of an object, initializing it with the selected data specified by the data object. If <i>fCreation</i> is <b>FALSE</b>, the caller is attempting to replace the object's current contents with that pointed to by <i>pDataObject</i>. The usual constraints that apply to an object during a paste operation should be applied here. For example, if the type of the data provided is unacceptable, the object should fail to initialize and return S_FALSE. If the object returns S_FALSE, it cannot initialize itself from the provided data.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-initfromdata#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void InitFromData(winmdroot.System.Com.IDataObject* pDataObject, winmdroot.Foundation.BOOL fCreation, uint dwReserved)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.BOOL ,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IOleObject*)Unsafe.AsPointer(ref this), pDataObject, fCreation, dwReserved).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetClipboardData(IOleObject* pThis, uint dwReserved, winmdroot.System.Com.IDataObject** ppDataObject)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetClipboardData(dwReserved, ppDataObject);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves a data object containing the current contents of the embedded object on which this method is called. Using the pointer to this data object, it is possible to create a new embedded object with the same data as the original.</summary>
			/// <param name="dwReserved">This parameter is reserved and must be zero.</param>
			/// <param name="ppDataObject">Address of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a> pointer variable that receives the interface pointer to the data object. If an error occurs, <i>ppDataObject</i> must be set to <b>NULL</b>. Each time an object receives a call to <b>IOleObject::GetClipboardData</b>, it must increase the reference count on <i>ppDataObject</i>. It is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> when it is done with <i>ppDataObject</i>.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>You can use the <b>IOleObject::GetClipboardData</b> method to convert a linked object to an embedded object, in which case the container application would call <b>IOleObject::GetClipboardData</b> and then pass the data received to <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olecreatefromdata">OleCreateFromData</a>. This method returns a pointer to a data object that is identical to what would have been passed to the clipboard by a standard copy operation. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> If you want a stable snapshot of the current contents of an embedded object, call <b>IOleObject::GetClipboardData</b>. Should the data change, you will need to call the function again for an updated snapshot. If you want the caller to be informed of changes that occur to the data, call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q)">QueryInterface</a>, then call <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-idataobject-dadvise">IDataObject::DAdvise</a>. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> If you implement this function, you must return an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a> pointer for an object whose data will not change.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-getclipboarddata#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void GetClipboardData(uint dwReserved, winmdroot.System.Com.IDataObject** ppDataObject)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.System.Com.IDataObject** ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IOleObject*)Unsafe.AsPointer(ref this), dwReserved, ppDataObject).ThrowOnFailure();
			}

			/// <inheritdoc cref="DoVerb(int, winmdroot.UI.WindowsAndMessaging.MSG*, winmdroot.System.Ole.IOleClientSite*, int, winmdroot.Foundation.HWND, winmdroot.Foundation.RECT*)"/>
			internal unsafe winmdroot.Foundation.HRESULT DoVerb(int iVerb, in winmdroot.UI.WindowsAndMessaging.MSG lpmsg, winmdroot.System.Ole.IOleClientSite* pActiveSite, int lindex, winmdroot.Foundation.HWND hwndParent, in winmdroot.Foundation.RECT lprcPosRect)
			{
				fixed (winmdroot.Foundation.RECT* lprcPosRectLocal = &lprcPosRect)
				{
					fixed (winmdroot.UI.WindowsAndMessaging.MSG* lpmsgLocal = &lpmsg)
					{
						winmdroot.Foundation.HRESULT __result = this.DoVerb(iVerb, lpmsgLocal, pActiveSite, lindex, hwndParent, lprcPosRectLocal);
						return __result;
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT DoVerb(IOleObject* pThis, int iVerb, winmdroot.UI.WindowsAndMessaging.MSG* lpmsg, winmdroot.System.Ole.IOleClientSite* pActiveSite, int lindex, winmdroot.Foundation.HWND hwndParent, winmdroot.Foundation.RECT* lprcPosRect)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.DoVerb(iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Requests that an object perform an action in response to an end-user's action. The possible actions are enumerated for the object in IOleObject::EnumVerbs.</summary>
			/// <param name="iVerb">Number assigned to the verb in the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ns-oleidl-oleverb">OLEVERB</a> structure returned by <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-enumverbs">IOleObject::EnumVerbs</a>.</param>
			/// <param name="lpmsg">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/ns-winuser-msg">MSG</a> structure describing the event (such as a double-click) that invoked the verb. The caller should pass the <b>MSG</b> structure unmodified, without attempting to interpret or alter the values of any of the structure members.</param>
			/// <param name="pActiveSite">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleclientsite">IOleClientSite</a> interface on the object's active client site, where the event occurred that invoked the verb.</param>
			/// <param name="lindex">This parameter is reserved and must be zero.</param>
			/// <param name="hwndParent">Handle of the document window containing the object. This and <i>lprcPosRect</i> together make it possible to open a temporary window for an object, where <i>hwndParent</i> is the parent window in which the object's window is to be displayed, and <i>lprcPosRect</i> defines the area available for displaying the object window within that parent. A temporary window is useful, for example, to a multimedia object that opens itself for playback but not for editing.</param>
			/// <param name="lprcPosRect">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/windef/ns-windef-rect">RECT</a> structure containing the coordinates, in pixels, that define an object's bounding rectangle in <i>hwndParent</i>. This and <i>hwndParent</i> together enable opening multimedia objects for playback but not for editing.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>A "verb" is an action that an OLE object takes in response to a message from its container. An object's container, or a client linked to the object, normally calls <b>IOleObject::DoVerb</b> in response to some end-user action, such as double-clicking on the object. The various actions that are available for a given object are enumerated in an <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ns-oleidl-oleverb">OLEVERB</a> structure, which the container obtains by calling <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-enumverbs">IOleObject::EnumVerbs</a>. <b>IOleObject::DoVerb</b> matches the value of iVerb against the iVerb member of the structure to determine which verb to invoke. Through <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-enumverbs">IOleObject::EnumVerbs</a>, an object, rather than its container, determines which verbs (i.e., actions) it supports. OLE 2 defines seven verbs that are available, but not necessarily useful, to all objects. In addition, each object can define additional verbs that are unique to it. The following table describes the verbs defined by OLE. </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-doverb#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT DoVerb(int iVerb, winmdroot.UI.WindowsAndMessaging.MSG* lpmsg, winmdroot.System.Ole.IOleClientSite* pActiveSite, int lindex, winmdroot.Foundation.HWND hwndParent, winmdroot.Foundation.RECT* lprcPosRect)
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,int ,winmdroot.UI.WindowsAndMessaging.MSG* ,winmdroot.System.Ole.IOleClientSite* ,int ,winmdroot.Foundation.HWND ,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IOleObject*)Unsafe.AsPointer(ref this), iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT EnumVerbs(IOleObject* pThis, winmdroot.System.Ole.IEnumOLEVERB** ppEnumOleVerb)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.EnumVerbs(ppEnumOleVerb);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Exposes a pull-down menu listing the verbs available for an object in ascending order by verb number.</summary>
			/// <param name="ppEnumOleVerb">Address of <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ienumoleverb">IEnumOLEVERB</a> pointer variable that receives the interface pointer to the new enumerator object. Each time an object receives a call to <b>IOleObject::EnumVerbs</b>, it must increase the reference count on <i>ppEnumOleVerb</i>. It is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">IUnknown::Release</a> when it is done with <i>ppEnumOleVerb</i>. If an error occurs, <i>ppEnumOleVerb</i> must be set to <b>NULL</b>.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-enumverbs">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void EnumVerbs(winmdroot.System.Ole.IEnumOLEVERB** ppEnumOleVerb)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Ole.IEnumOLEVERB** ,winmdroot.Foundation.HRESULT>)lpVtbl[12])((IOleObject*)Unsafe.AsPointer(ref this), ppEnumOleVerb).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Update(IOleObject* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Update();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Updates an object handler's or link object's data or view caches.</summary>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The <b>Update</b> method provides a way for containers to keep data updated in their linked and embedded objects. A link object can become out-of-date if the link source has been updated. An embedded object that contains links to other objects can also become out of date. An embedded object that does not contain links cannot become out of date because its data is not linked to another source. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> When a container calls a link object's <b>IOleObject::Update</b> method, the link object finds the link source and gets a new presentation from it. This process may also involve running one or more object applications, which could be time-consuming. When a container calls an embedded object's <b>IOleObject::Update</b> method, it is requesting the object to update all link objects it may contain. In response, the object handler recursively calls <b>IOleObject::Update</b> for each of its own linked objects, running each one as needed.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-update#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void Update()
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Foundation.HRESULT>)lpVtbl[13])((IOleObject*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT IsUpToDate(IOleObject* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.IsUpToDate();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Checks whether an object is up to date.</summary>
			/// <returns>
			/// <para>This method returns S_OK if the object is up to date; otherwise, S_FALSE. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The <b>IOleObject::IsUpToDate</b> method provides a way for containers to check recursively whether all objects are up to date. That is, when the container calls this method on the first object, the object in turn calls it for all its own objects, and they in turn for all of theirs, until all objects have been checked.</para>
			/// <para><h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Because of the recursive nature of <b>IOleObject::IsUpToDate</b>, determining whether an object is out-of-date, particularly one containing one or more other objects, can be as time-consuming as simply updating the object in the first place. If you would rather avoid lengthy queries of this type, make sure that <b>IOleObject::IsUpToDate</b> returns OLE_E_UNAVAILABLE. In cases where the object to be queried is small and contains no objects itself, thereby making an efficient query possible, this method can return either S_OK or S_FALSE.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-isuptodate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void IsUpToDate()
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Foundation.HRESULT>)lpVtbl[14])((IOleObject*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			/// <inheritdoc cref="GetUserClassID(global::System.Guid*)"/>
			internal unsafe void GetUserClassID(out global::System.Guid pClsid)
			{
				fixed (global::System.Guid* pClsidLocal = &pClsid)
				{
					this.GetUserClassID(pClsidLocal);
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetUserClassID(IOleObject* pThis, global::System.Guid* pClsid)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetUserClassID(pClsid);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves an object's class identifier, the CLSID corresponding to the string identifying the object to an end user.</summary>
			/// <param name="pClsid">Pointer to the class identifier (CLSID) to be returned. An object's CLSID is the binary equivalent of the user-type name returned by <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-getusertype">IOleObject::GetUserType</a>.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks><b>IOleObject::GetUserClassID</b> returns the CLSID associated with the object in the registration database. Normally, this value is identical to the CLSID stored with the object, which is returned by <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ipersist-getclassid">IPersist::GetClassID</a>. For linked objects, this is the CLSID of the last bound link source. If the object is running in an application different from the one in which it was created and for the purpose of being edited is emulating a class that the container application recognizes, the CLSID returned will be that of the class being emulated rather than that of the object's own class.</remarks>
			public unsafe void GetUserClassID(global::System.Guid* pClsid)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,global::System.Guid* ,winmdroot.Foundation.HRESULT>)lpVtbl[15])((IOleObject*)Unsafe.AsPointer(ref this), pClsid).ThrowOnFailure();
			}

			/// <inheritdoc cref="GetUserType(uint, winmdroot.Foundation.PWSTR*)"/>
			internal unsafe void GetUserType(uint dwFormOfType, out winmdroot.Foundation.PWSTR pszUserType)
			{
				fixed (winmdroot.Foundation.PWSTR* pszUserTypeLocal = &pszUserType)
				{
					this.GetUserType(dwFormOfType, pszUserTypeLocal);
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetUserType(IOleObject* pThis, uint dwFormOfType, winmdroot.Foundation.PWSTR* pszUserType)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetUserType(dwFormOfType, pszUserType);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the user-type name of an object for display in user-interface elements such as menus, list boxes, and dialog boxes.</summary>
			/// <param name="dwFormOfType">The form of the user-type name to be presented to users. Possible values are obtained from the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-userclasstype">USERCLASSTYPE</a> enumeration.</param>
			/// <param name="pszUserType">Address of <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ns-ocidl-calpolestr">LPOLESTR</a> pointer variable that receives a pointer to the user type string. The caller must free <i>pszUserType</i> using the current <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imalloc">IMalloc</a> instance. If an error occurs, the implementation must set <i>pszUserType</i> to <b>NULL</b>.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Containers call <b>IOleObject::GetUserType</b> in order to represent embedded objects in list boxes, menus, and dialog boxes by their normal, user-recognizable names. Examples include "Word Document," "Excel Chart," and "Paintbrush Object." The information returned by <b>IOleObject::GetUserType</b> is the user-readable equivalent of the binary class identifier returned by <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-getuserclassid">IOleObject::GetUserClassID</a>. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The default handler's implementation of <b>IOleObject::GetUserType</b> uses the object's class identifier (the <i>pClsid</i> parameter returned by <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-getuserclassid">IOleObject::GetUserClassID</a>) and the <i>dwFormOfType</i> parameter together as a key into the registry. If an entry is found that matches the key exactly, then the user type specified by that entry is returned. If only the CLSID part of the key matches, then the lowest-numbered entry available (usually the full name) is used. If the CLSID is not found, or there are no user types registered for the class, the user type currently found in the object's storage is used. You should not cache the string returned from <b>IOleObject::GetUserType</b>. Instead, call this method each and every time the string is needed. This guarantees correct results when the embedded object is being converted from one type into another without the caller's knowledge. Calling this method is inexpensive because the default handler implements it using the registry.</para>
			/// <para><h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> You can use the implementation provided by the default handler by returning OLE_S_USEREG as your application's implementation of this method. If the user type name is an empty string, the message "Unknown Object" is returned. You can call the OLE helper function <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olereggetusertype">OleRegGetUserType</a> to return the appropriate user type.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-getusertype#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void GetUserType(uint dwFormOfType, winmdroot.Foundation.PWSTR* pszUserType)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.Foundation.PWSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[16])((IOleObject*)Unsafe.AsPointer(ref this), dwFormOfType, pszUserType).ThrowOnFailure();
			}

			/// <inheritdoc cref="SetExtent(winmdroot.System.Com.DVASPECT, winmdroot.Foundation.SIZE*)"/>
			internal unsafe winmdroot.Foundation.HRESULT SetExtent(winmdroot.System.Com.DVASPECT dwDrawAspect, in winmdroot.Foundation.SIZE psizel)
			{
				fixed (winmdroot.Foundation.SIZE* psizelLocal = &psizel)
				{
					winmdroot.Foundation.HRESULT __result = this.SetExtent(dwDrawAspect, psizelLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetExtent(IOleObject* pThis, winmdroot.System.Com.DVASPECT dwDrawAspect, winmdroot.Foundation.SIZE* psizel)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetExtent(dwDrawAspect, psizel);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Informs an object of how much display space its container has assigned it.</summary>
			/// <param name="dwDrawAspect">DWORD that describes which form, or "aspect," of an object is to be displayed. The object's container obtains this value from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> (refer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-formatetc">FORMATETC</a> enumeration). The most common aspect is DVASPECT_CONTENT, which specifies a full rendering of the object within its container. An object can also be rendered as an icon, a thumbnail version for display in a browsing tool, or a print version, which displays the object as it would be rendered using the <b>File Print</b> command.</param>
			/// <param name="psizel">Pointer to the size limit for the object.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>A container calls <b>IOleObject::SetExtent</b> when it needs to dictate to an embedded object the size at which it will be displayed. Often, this call occurs in response to an end user resizing the object window. Upon receiving the call, the object, if possible, should recompose itself gracefully to fit the new window. Whenever possible, a container seeks to display an object at its finest resolution, sometimes called the object's native size. All objects, however, have a default display size specified by their applications, and in the absence of other constraints, this is the size they will use to display themselves. Since an object knows its optimum display size better than does its container, the latter normally requests that size from a running object by calling <b>IOleObject::SetExtent</b>. Only in cases where the container cannot accommodate the value returned by the object does it override the object's preference by calling <b>IOleObject::SetExtent</b>. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> You can call <b>IOleObject::SetExtent</b> on an object only when the object is running. If a container resizes an object while an object is not running, the container should keep track of the object's new size but defer calling <b>IOleObject::SetExtent</b> until a user activates the object. If the OLEMISC_RECOMPOSEONRESIZE bit is set on an object, its container should force the object to run before calling <b>IOleObject::SetExtent</b>. As noted above, a container may want to delegate responsibility for setting the size of an object's display site to the object itself, by calling <b>IOleObject::SetExtent</b>. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> You may want to implement this method so that your object rescales itself to match as closely as possible the maximum space available to it in its container. If an object's size is fixed, that is, if it cannot be set by its container, <b>IOleObject::SetExtent</b> should return E_FAIL. This is always the case with linked objects, whose sizes are set by their link sources, not by their containers.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-setextent#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT SetExtent(winmdroot.System.Com.DVASPECT dwDrawAspect, winmdroot.Foundation.SIZE* psizel)
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.DVASPECT ,winmdroot.Foundation.SIZE* ,winmdroot.Foundation.HRESULT>)lpVtbl[17])((IOleObject*)Unsafe.AsPointer(ref this), dwDrawAspect, psizel);
			}

			/// <inheritdoc cref="GetExtent(winmdroot.System.Com.DVASPECT, winmdroot.Foundation.SIZE*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetExtent(winmdroot.System.Com.DVASPECT dwDrawAspect, out winmdroot.Foundation.SIZE psizel)
			{
				fixed (winmdroot.Foundation.SIZE* psizelLocal = &psizel)
				{
					winmdroot.Foundation.HRESULT __result = this.GetExtent(dwDrawAspect, psizelLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetExtent(IOleObject* pThis, winmdroot.System.Com.DVASPECT dwDrawAspect, winmdroot.Foundation.SIZE* psizel)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetExtent(dwDrawAspect, psizel);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves a running object's current display size.</summary>
			/// <param name="dwDrawAspect">The aspect of the object whose limit is to be retrieved; the value is obtained from the enumerations <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> and from <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ne-ocidl-dvaspect2">DVASPECT2</a>. Note that newer objects and containers that support optimized drawing interfaces support the <b>DVASPECT2</b> enumeration values. Older objects and containers that do not support optimized drawing interfaces may not support <b>DVASPECT2</b>. The most common value for this method is DVASPECT_CONTENT, which specifies a full rendering of the object within its container.</param>
			/// <param name="psizel">Pointer to where the object's size is to be returned.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>A container calls <b>IOleObject::GetExtent</b> on a running object to retrieve its current display size. If the container can accommodate that size, it will normally do so because the object, after all, knows what size it should be better than the container does. A container normally makes this call as part of initializing an object. The display size returned by <b>IOleObject::GetExtent</b> may differ from the size last set by <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-setextent">IOleObject::SetExtent</a> because the latter method dictates the object's display space at the time the method is called but does not necessarily change the object's native size, as determined by its application. If one of the new aspects is requested in <i>dwAspect</i>, this method can either fail or return the same rectangle as for the DVASPECT_CONTENT aspect. <div class="alert"><b>Note</b>  This method must return the same size as DVASPECT_CONTENT for all the new aspects in <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ne-ocidl-dvaspect2">DVASPECT2</a>. <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject2-getextent">IViewObject2::GetExtent</a> must do the same thing.</div> <div> </div> <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Because a container can make this call only to a running object, the container must instead call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject2-getextent">IViewObject2::GetExtent</a> if it wants to get the display size of a loaded object from its cache. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Implementation consists of filling the sizel structure with an object's height and width.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-getextent#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetExtent(winmdroot.System.Com.DVASPECT dwDrawAspect, winmdroot.Foundation.SIZE* psizel)
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.DVASPECT ,winmdroot.Foundation.SIZE* ,winmdroot.Foundation.HRESULT>)lpVtbl[18])((IOleObject*)Unsafe.AsPointer(ref this), dwDrawAspect, psizel);
			}

			/// <inheritdoc cref="Advise(winmdroot.System.Com.IAdviseSink*, uint*)"/>
			internal unsafe void Advise(winmdroot.System.Com.IAdviseSink* pAdvSink, out uint pdwConnection)
			{
				fixed (uint* pdwConnectionLocal = &pdwConnection)
				{
					this.Advise(pAdvSink, pdwConnectionLocal);
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Advise(IOleObject* pThis, winmdroot.System.Com.IAdviseSink* pAdvSink, uint* pdwConnection)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Advise(pAdvSink, pdwConnection);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Establishes an advisory connection between a compound document object and the calling object's advise sink, through which the calling object receives notification when the compound document object is renamed, saved, or closed.</summary>
			/// <param name="pAdvSink">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-iadvisesink">IAdviseSink</a> interface on the advise sink of the calling object.</param>
			/// <param name="pdwConnection">Pointer to a token that can be passed to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-unadvise">IOleObject::Unadvise</a> to delete the advisory connection.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The <b>IOleObject::Advise</b> method sets up an advisory connection between an object and its container, through which the object informs the container's advise sink of close, save, rename, and link-source change events in the object. A container calls this method, normally as part of initializing an object, to register its advisory sink with the object. In return, the object sends the container compound-document notifications by calling <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-iadvisesink">IAdviseSink</a> or <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-iadvisesink2">IAdviseSink2</a>. If container and object successfully establish an advisory connection, the object receiving the call returns a nonzero value through <i>pdwConnection</i> to the container. If the attempt to establish an advisory connection fails, the object returns zero. To delete an advisory connection, the container calls <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-unadvise">IOleObject::Unadvise</a> and passes this nonzero token back to the object. An object can delegate the job of managing and tracking advisory events to an OLE advise holder, to which you obtain a pointer by calling <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-createoleadviseholder">CreateOleAdviseHolder</a>. The returned <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleadviseholder">IOleAdviseHolder</a> interface has three methods for sending advisory notifications, as well as <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleadviseholder-advise">IOleAdviseHolder::Advise</a>, <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleadviseholder-unadvise">IOleAdviseHolder::Unadvise</a>, and <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleadviseholder-enumadvise">IOleAdviseHolder::EnumAdvise</a> methods that are identical to those for <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleobject">IOleObject</a>. Calls to <b>IOleObject::Advise</b>, <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-unadvise">IOleObject::Unadvise</a>, or <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-enumadvise">IOleObject::EnumAdvise</a> are delegated to corresponding methods in the advise holder. To destroy the advise holder, simply call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">IUnknown::Release</a> on the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleadviseholder">IOleAdviseHolder</a> interface.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-advise#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void Advise(winmdroot.System.Com.IAdviseSink* pAdvSink, uint* pdwConnection)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.IAdviseSink* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[19])((IOleObject*)Unsafe.AsPointer(ref this), pAdvSink, pdwConnection).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Unadvise(IOleObject* pThis, uint dwConnection)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Unadvise(dwConnection);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Deletes a previously established advisory connection. (IOleObject.Unadvise)</summary>
			/// <param name="dwConnection">Contains a token of nonzero value, which was previously returned from <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-advise">IOleObject::Advise</a> through its <i>pdwConnection</i> parameter.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>Normally, containers call <b>IOleObject::Unadvise</b> at shutdown or when an object is deleted. In certain cases, containers can call this method on objects that are running but not currently visible as a way of reducing the overhead of maintaining multiple advisory connections. The easiest way to implement this method is to delegate the call to <b>IOleObject::Unadvise</b>.</remarks>
			public void Unadvise(uint dwConnection)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[20])((IOleObject*)Unsafe.AsPointer(ref this), dwConnection).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT EnumAdvise(IOleObject* pThis, winmdroot.System.Com.IEnumSTATDATA** ppenumAdvise)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.EnumAdvise(ppenumAdvise);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves a pointer to an enumerator that can be used to enumerate the advisory connections registered for an object, so a container can know what to release prior to closing down.</summary>
			/// <param name="ppenumAdvise">Address of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ienumstatdata">IEnumSTATDATA</a> pointer variable that receives the interface pointer to the enumerator object. If the object does not have any advisory connections or if an error occurs, the implementation must set <i>ppenumAdvise</i> to <b>NULL</b>. Each time an object receives a successful call to <b>IOleObject::EnumAdvise</b>, it must increase the reference count on <i>ppenumAdvise</i>. It is the caller's responsibility to call Release when it is done with the <i>ppenumAdvise</i>.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The <b>IOleObject::EnumAdvise</b> method supplies an enumerator that provides a way for containers to keep track of advisory connections registered for their objects. A container normally would call this function so that it can instruct an object to release each of its advisory connections prior to closing down. The enumerator to which you get access through <b>IOleObject::EnumAdvise</b> enumerates items of type <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-statdata">STATDATA</a>. Upon receiving the pointer, the container can then loop through <b>STATDATA</b> and call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-unadvise">IOleObject::Unadvise</a> for each enumerated connection. The usual way to implement this function is to delegate the call to the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleadviseholder">IOleAdviseHolder</a> interface. Only the <b>pAdvise</b> and <b>dwConnection</b> members of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-statdata">STATDATA</a> are relevant for <b>IOleObject::EnumAdvise</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-enumadvise#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void EnumAdvise(winmdroot.System.Com.IEnumSTATDATA** ppenumAdvise)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.IEnumSTATDATA** ,winmdroot.Foundation.HRESULT>)lpVtbl[21])((IOleObject*)Unsafe.AsPointer(ref this), ppenumAdvise).ThrowOnFailure();
			}

			/// <inheritdoc cref="GetMiscStatus(winmdroot.System.Com.DVASPECT, winmdroot.System.Ole.OLEMISC*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetMiscStatus(winmdroot.System.Com.DVASPECT dwAspect, out winmdroot.System.Ole.OLEMISC pdwStatus)
			{
				fixed (winmdroot.System.Ole.OLEMISC* pdwStatusLocal = &pdwStatus)
				{
					winmdroot.Foundation.HRESULT __result = this.GetMiscStatus(dwAspect, pdwStatusLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetMiscStatus(IOleObject* pThis, winmdroot.System.Com.DVASPECT dwAspect, winmdroot.System.Ole.OLEMISC* pdwStatus)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetMiscStatus(dwAspect, pdwStatus);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the status of an object at creation and loading.</summary>
			/// <param name="dwAspect">The aspect of an object about which status information is being requested. The value is obtained from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a>.</param>
			/// <param name="pdwStatus">Pointer to where the status information is returned. This parameter cannot be <b>NULL</b>.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>A container normally calls <b>IOleObject::GetMiscStatus</b> when it creates or loads an object in order to determine how to display the object and what types of behaviors it supports. Objects store status information in the registry. If the object is not running, the default handler's implementation of <b>IOleObject::GetMiscStatus</b> retrieves this information from the registry. If the object is running, the default handler invokes <b>IOleObject::GetMiscStatus</b> on the object itself. The information that is actually stored in the registry varies with individual objects. The status values to be returned are defined in the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-olemisc">OLEMISC</a>. The default value of <b>IOleObject::GetMiscStatus</b> is used if a subkey corresponding to the specified <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> is not found. To set an OLE control, specify DVASPECT==1. This will cause the following to occur in the registry:</para>
			/// <para><pre><b>HKEY_CLASSES_ROOT\CLSID\ . . .</b> <b>MiscStatus</b> = 1</pre></para>
			/// <para><h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Implementation normally consists of delegating the call to the default handler.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleobject-getmiscstatus#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetMiscStatus(winmdroot.System.Com.DVASPECT dwAspect, winmdroot.System.Ole.OLEMISC* pdwStatus)
			{
				return ((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.DVASPECT ,winmdroot.System.Ole.OLEMISC* ,winmdroot.Foundation.HRESULT>)lpVtbl[22])((IOleObject*)Unsafe.AsPointer(ref this), dwAspect, pdwStatus);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetColorScheme(IOleObject* pThis, winmdroot.Graphics.Gdi.LOGPALETTE* pLogpal)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetColorScheme(pLogpal);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Specifies the color palette that the object application should use when it edits the specified object.</summary>
			/// <param name="pLogpal">Pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/ns-wingdi-logpalette">LOGPALETTE</a> structure that specifies the recommended palette.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>The <b>IOleObject::SetColorScheme</b> method sends the container application's recommended color palette to the object application, which is not obliged to use it.</remarks>
			public unsafe void SetColorScheme(winmdroot.Graphics.Gdi.LOGPALETTE* pLogpal)
			{
				((delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Graphics.Gdi.LOGPALETTE* ,winmdroot.Foundation.HRESULT>)lpVtbl[23])((IOleObject*)Unsafe.AsPointer(ref this), pLogpal).ThrowOnFailure();
			}

			internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv)
where T : unmanaged

			{
				var hr = this.QueryInterface(typeof(T).GUID, out void* pv);
				if (hr.Succeeded)

				{
					ppv = (T*)pv;
				}
				else

				{
					ppv = null;
				}

				return hr;
			}

			internal struct Vtbl
			{
				internal delegate *unmanaged [Stdcall]<IOleObject*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint> AddRef_2;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint> Release_3;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Ole.IOleClientSite* ,winmdroot.Foundation.HRESULT> SetClientSite_4;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Ole.IOleClientSite** ,winmdroot.Foundation.HRESULT> GetClientSite_5;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetHostNames_6;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.Foundation.HRESULT> Close_7;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.System.Com.IMoniker* ,winmdroot.Foundation.HRESULT> SetMoniker_8;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint ,uint ,winmdroot.System.Com.IMoniker** ,winmdroot.Foundation.HRESULT> GetMoniker_9;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.BOOL ,uint ,winmdroot.Foundation.HRESULT> InitFromData_10;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.System.Com.IDataObject** ,winmdroot.Foundation.HRESULT> GetClipboardData_11;

				internal delegate *unmanaged [Stdcall]<IOleObject*,int ,winmdroot.UI.WindowsAndMessaging.MSG* ,winmdroot.System.Ole.IOleClientSite* ,int ,winmdroot.Foundation.HWND ,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> DoVerb_12;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Ole.IEnumOLEVERB** ,winmdroot.Foundation.HRESULT> EnumVerbs_13;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Foundation.HRESULT> Update_14;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Foundation.HRESULT> IsUpToDate_15;

				internal delegate *unmanaged [Stdcall]<IOleObject*,global::System.Guid* ,winmdroot.Foundation.HRESULT> GetUserClassID_16;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.Foundation.PWSTR* ,winmdroot.Foundation.HRESULT> GetUserType_17;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.DVASPECT ,winmdroot.Foundation.SIZE* ,winmdroot.Foundation.HRESULT> SetExtent_18;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.DVASPECT ,winmdroot.Foundation.SIZE* ,winmdroot.Foundation.HRESULT> GetExtent_19;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.IAdviseSink* ,uint* ,winmdroot.Foundation.HRESULT> Advise_20;

				internal delegate *unmanaged [Stdcall]<IOleObject*,uint ,winmdroot.Foundation.HRESULT> Unadvise_21;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.IEnumSTATDATA** ,winmdroot.Foundation.HRESULT> EnumAdvise_22;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.System.Com.DVASPECT ,winmdroot.System.Ole.OLEMISC* ,winmdroot.Foundation.HRESULT> GetMiscStatus_23;

				internal delegate *unmanaged [Stdcall]<IOleObject*,winmdroot.Graphics.Gdi.LOGPALETTE* ,winmdroot.Foundation.HRESULT> SetColorScheme_24;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->SetClientSite_4 = &SetClientSite;
				vtable->GetClientSite_5 = &GetClientSite;
				vtable->SetHostNames_6 = &SetHostNames;
				vtable->Close_7 = &Close;
				vtable->SetMoniker_8 = &SetMoniker;
				vtable->GetMoniker_9 = &GetMoniker;
				vtable->InitFromData_10 = &InitFromData;
				vtable->GetClipboardData_11 = &GetClipboardData;
				vtable->DoVerb_12 = &DoVerb;
				vtable->EnumVerbs_13 = &EnumVerbs;
				vtable->Update_14 = &Update;
				vtable->IsUpToDate_15 = &IsUpToDate;
				vtable->GetUserClassID_16 = &GetUserClassID;
				vtable->GetUserType_17 = &GetUserType;
				vtable->SetExtent_18 = &SetExtent;
				vtable->GetExtent_19 = &GetExtent;
				vtable->Advise_20 = &Advise;
				vtable->Unadvise_21 = &Unadvise;
				vtable->EnumAdvise_22 = &EnumAdvise;
				vtable->GetMiscStatus_23 = &GetMiscStatus;
				vtable->SetColorScheme_24 = &SetColorScheme;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{00000112-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x00000112, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x12,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("00000112-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT SetClientSite(winmdroot.System.Ole.IOleClientSite* pClientSite);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetClientSite(winmdroot.System.Ole.IOleClientSite** ppClientSite);

								[PreserveSig()]
winmdroot.Foundation.HRESULT SetHostNames(winmdroot.Foundation.PCWSTR szContainerApp, winmdroot.Foundation.PCWSTR szContainerObj);

								[PreserveSig()]
winmdroot.Foundation.HRESULT Close(uint dwSaveOption);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT SetMoniker(uint dwWhichMoniker, winmdroot.System.Com.IMoniker* pmk);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetMoniker(uint dwAssign, uint dwWhichMoniker, winmdroot.System.Com.IMoniker** ppmk);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT InitFromData(winmdroot.System.Com.IDataObject* pDataObject, winmdroot.Foundation.BOOL fCreation, uint dwReserved);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetClipboardData(uint dwReserved, winmdroot.System.Com.IDataObject** ppDataObject);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT DoVerb(int iVerb, winmdroot.UI.WindowsAndMessaging.MSG* lpmsg, winmdroot.System.Ole.IOleClientSite* pActiveSite, int lindex, winmdroot.Foundation.HWND hwndParent, winmdroot.Foundation.RECT* lprcPosRect);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT EnumVerbs(winmdroot.System.Ole.IEnumOLEVERB** ppEnumOleVerb);

								[PreserveSig()]
winmdroot.Foundation.HRESULT Update();

								[PreserveSig()]
winmdroot.Foundation.HRESULT IsUpToDate();

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetUserClassID(global::System.Guid* pClsid);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetUserType(uint dwFormOfType, winmdroot.Foundation.PWSTR* pszUserType);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT SetExtent(winmdroot.System.Com.DVASPECT dwDrawAspect, winmdroot.Foundation.SIZE* psizel);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetExtent(winmdroot.System.Com.DVASPECT dwDrawAspect, winmdroot.Foundation.SIZE* psizel);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Advise(winmdroot.System.Com.IAdviseSink* pAdvSink, uint* pdwConnection);

								[PreserveSig()]
winmdroot.Foundation.HRESULT Unadvise(uint dwConnection);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT EnumAdvise(winmdroot.System.Com.IEnumSTATDATA** ppenumAdvise);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetMiscStatus(winmdroot.System.Com.DVASPECT dwAspect, winmdroot.System.Ole.OLEMISC* pdwStatus);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT SetColorScheme(winmdroot.Graphics.Gdi.LOGPALETTE* pLogpal);
			}
		}
	}
}