Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

IDocHostShowUI (Interfaces)
 
.
Summary
TODO - a short description

C# Definition:

[ComImport]
[Guid("C4D244B0-D43E-11CF-893B-00AA00BDCE1A")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown) ]
public interface IDocHostShowUI
{
     [PreserveSig]
     uint ShowMessage(IntPtr hwnd,
     [MarshalAs(UnmanagedType.LPWStr)] string lpstrText,
     [MarshalAs(UnmanagedType.LPWStr)] string lpstrCaption,
     uint dwType,
     [MarshalAs(UnmanagedType.LPWStr)] string lpstrHelpFile,
     uint dwHelpContext,
     out int lpResult);

     [PreserveSig]
     uint ShowHelp(IntPtr hwnd, [MarshalAs(UnmanagedType.LPWStr)] string pszHelpFile,
     uint uCommand, uint dwData,
     tagPOINT ptMouse,
     [MarshalAs(UnmanagedType.IDispatch)] object pDispatchObjectHit);              
}

VB Definition:

<ComImport(), Guid("C4D244B0-D43E-11CF-893B-00AA00BDCE1A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
  Public Interface         
    <PreserveSig()> _
    Function ShowMessage(ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpstrText As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpstrCaption As String, ByVal dwType As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpstrHelpFile As String, ByVal dwHelpContext As Integer, ByRef lpResult As Integer) As Integer

    <PreserveSig()> _
    Function ShowHelp(ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.LPWStr)> ByVal pszHelpFile As String, ByVal uCommand As Integer, ByVal dwData As Integer, ByVal ptMouse As tagPoint, <MarshalAs(UnmanagedType.IDispatch)> ByVal pDispatchObjectHit As Object) As Integer
<ComImport> _
<Guid("TODO")> _
'TODO: Insert <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ if this doesn't derive from IDispatch
Interface IDocHostShowUI
   TODO
End Interface

User-Defined Types:

None.

Notes:

The original definition on this page marshalled the strings as UnmanagedType.BStr which I think was incorrect since the underlying type is LPOLESTR. I experienced heap corruption and instability. ShowMessage also did not appear to be called reliably.

I've encountered exactly the same unreliable (sometimes called, sometimes not) behavior in vb .net 2005, when using BSTR, LPWSTR version works fine.

The original definition on this page marshalled the strings as UnmanagedType.BStr.

I think this is wrong since the underlying type is LPOLESTR.

Documentation

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.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions