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 Interfaces, prefix the name with the module name and a period.
[ComImport]
[Guid("7FD52380-4E07-101B-AE2D-08002B2EC713")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IPersistStreamInit {
int GetClassID (out Guid pClassID);
void GetSizeMax ([OutAttribute] ulong[] pcbSize);
void InitNew ();
int IsDirty ();
void Load ([InAttribute] IStream pstm);
void Save ([InAttribute] IStream pstm, [InAttribute] int fClearDirty);
}
VB Definition:
<ComImport> _
<Guid("7FD52380-4E07-101B-AE2D-08002B2EC713")> _
'TODO: Insert <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ if this doesn't derive from IDispatch
Interface IPersistStreamInit
TODO
End Interface
User-Defined Types:
None.
Notes:
None.
// Example -----------------------Note: In C#, use IPersistStreamInit ----------------------
public string _strErrorMsg;
public string GetComObjectGUID(object objComCtrl)
{
IntPtr pIPStream = IntPtr.Zero;
string strStreamGUID = "NONE";
IntPtr pActiveXObj = IntPtr.Zero;
int iResult;
int S_OK = 0;
int E_FAIL = unchecked((int)0x80004005);
int E_NOINTERFACE = unchecked((int)0x80004002);
Guid IID_IPersistStreamInit = new Guid("7FD52380-4E07-101B-AE2D-08002B2EC713");
if (objComCtrl.GetType().IsCOMObject)
{
pActiveXObj = Marshal.GetIUnknownForObject((object)objComCtrl);
if (pActiveXObj == IntPtr.Zero)
{
ErrorMsg = "GetIUnknownForObject was zero.";
}
else
{
iResult = Marshal.QueryInterface(pActiveXObj, ref IID_IPersistStreamInit, out pIPStream);
if (iResult == E_NOINTERFACE)
{
ErrorMsg = "No such interface supported";
}
else if (iResult == E_FAIL)
{
ErrorMsg = "PersistStreamInit QueryInit failed.";
}
else if (iResult == S_OK)
{
IPersistStreamInit pPersistStream = (
IPersistStreamInit)Marshal.GetObjectForIUnknown(pIPStream);
Guid ptrClsId;
IPersist pPersist = (IPersist)pPersistStream ;
pPersist.GetClassID(out ptrClsId);
strStreamGUID = ptrClsId.ToString().ToUpper();
}
}
Marshal.Release(pActiveXObj); // not releasing gives a memory leak
Marshal.Release(pIPStream);
}
return (strStreamGUID);
}
public string ErrorMsg
{
get {return _strErrorMsg;}
set {_strErrorMsg = value;}
}
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.