none
VB2010 - how i add IRichEditOle interface?

    Question

  • i add it:

    <ComImport()> _
    <Guid("TODO")> _
    <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
        Interface IRichEditOle
            TODO
        End Interface

    'TODO' give me an error:  Interface members must be methods, properties, events, or type definitions.

    how can i resolve it?


    Monday, April 3, 2017 1:33 PM

Answers

  • Hi Cambalinho,

    Please modify the code like this:

    <ComImport> _
    <Guid("00020D00-0000-0000-C000-000000000046")> _
    <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
    Interface IRichEditOle
    	Sub GetClientSite(ByRef lplpolesite As IOleClientSite)
    	<PreserveSig> _
    	Function GetObjectCount() As Integer
    	<PreserveSig> _
    	Function GetLinkCount() As Integer
    	Sub GetObject(iob As Integer, ByRef lpreobject As REOBJECT, <MarshalAs(UnmanagedType.U4)> flags As GetObjectOptions)
    	Sub InsertObject(lpreobject As REOBJECT)
    	Sub ConvertObject(iob As Integer, rclsidNew As Guid, lpstrUserTypeNew As String)
    	Sub ActivateAs(rclsid As Guid, rclsidAs As Guid)
    	Sub SetHostNames(lpstrContainerApp As String, lpstrContainerObj As String)
    	Sub SetLinkAvailable(iob As Integer, fAvailable As Boolean)
    	Sub SetDvaspect(iob As Integer, dvaspect As UInteger)
    	Sub HandsOffStorage(iob As Integer)
    	Sub SaveCompleted(iob As Integer, lpstg As IStorage)
    	Sub InPlaceDeactivate()
    	Sub ContextSensitiveHelp(fEnterMode As Boolean)
    	Sub GetClipboardData(ByRef lpchrg As CHARRANGE, <MarshalAs(UnmanagedType.U4)> reco As GetClipboardDataFlags, ByRef lplpdataobj As IDataObject)
    	Sub ImportDataObject(lpdataobj As IDataObject, cf As Integer, hMetaPict As IntPtr)
    End Interface
    

    About the usage of the interface, please refer to the following link, which create a demo by using c#.

    https://www.codeproject.com/Articles/4528/Use-IRichEditOle-from-C

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Cambalinho Tuesday, April 4, 2017 10:35 AM
    Tuesday, April 4, 2017 8:23 AM
    Moderator

All replies

  • Hi Cambalinho,

    Please modify the code like this:

    <ComImport> _
    <Guid("00020D00-0000-0000-C000-000000000046")> _
    <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
    Interface IRichEditOle
    	Sub GetClientSite(ByRef lplpolesite As IOleClientSite)
    	<PreserveSig> _
    	Function GetObjectCount() As Integer
    	<PreserveSig> _
    	Function GetLinkCount() As Integer
    	Sub GetObject(iob As Integer, ByRef lpreobject As REOBJECT, <MarshalAs(UnmanagedType.U4)> flags As GetObjectOptions)
    	Sub InsertObject(lpreobject As REOBJECT)
    	Sub ConvertObject(iob As Integer, rclsidNew As Guid, lpstrUserTypeNew As String)
    	Sub ActivateAs(rclsid As Guid, rclsidAs As Guid)
    	Sub SetHostNames(lpstrContainerApp As String, lpstrContainerObj As String)
    	Sub SetLinkAvailable(iob As Integer, fAvailable As Boolean)
    	Sub SetDvaspect(iob As Integer, dvaspect As UInteger)
    	Sub HandsOffStorage(iob As Integer)
    	Sub SaveCompleted(iob As Integer, lpstg As IStorage)
    	Sub InPlaceDeactivate()
    	Sub ContextSensitiveHelp(fEnterMode As Boolean)
    	Sub GetClipboardData(ByRef lpchrg As CHARRANGE, <MarshalAs(UnmanagedType.U4)> reco As GetClipboardDataFlags, ByRef lplpdataobj As IDataObject)
    	Sub ImportDataObject(lpdataobj As IDataObject, cf As Integer, hMetaPict As IntPtr)
    End Interface
    

    About the usage of the interface, please refer to the following link, which create a demo by using c#.

    https://www.codeproject.com/Articles/4528/Use-IRichEditOle-from-C

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Cambalinho Tuesday, April 4, 2017 10:35 AM
    Tuesday, April 4, 2017 8:23 AM
    Moderator
  • thank you so much for that link.. thank you
    Tuesday, April 4, 2017 10:35 AM