Here it works nearly perfekt

Code: Select all
Structure RichEditOle
*pIntf.IRicheditOle
Refcount.l
hwnd.l
EndStructure
Procedure.l RichEdit_SetInterface(hWnd)
Protected No_Com.l
ForEach RichComObject()
If RichComObject()\hwnd=hwnd
No_Com=1
Break
EndIf
Next
If No_Com=0
AddElement(RichComObject())
RichComObject()\pIntf = ?VTable
RichComObject()\hwnd=hwnd
SendMessage_(hWnd, #EM_SETOLECALLBACK, 0, RichComObject())
ProcedureReturn RichComObject()
EndIf
EndProcedure
Procedure.l RichEdit_QueryInterface(*pObject.RichEditOle, REFIID, *ppvObj.LONG)
Protected *pointeur.IRicheditOle
*pointeur=*pObject
If CompareMemory(REFIID, ?IID_IUnknown, 16)=1 Or CompareMemory(REFIID, ?IID_IRichEditOleCallback, 16)=1
Debug "QueryInterface"
*ppvObj\l = *pObject
*pointeur\AddRef()
ProcedureReturn #S_OK
Else
*ppvObject=0
ProcedureReturn #E_NOINTERFACE
EndIf
EndProcedure
IID_IRichEditOleCallback: ;" 0x00020D03, 0, 0, 0xC0,0,0,0,0,0,0,0x46"
Data.l $00020D03
Data.w $0000,$0000
Data.b $C0,$00,$00,$00,$00,$00,$00,$46
IID_IUnknown: ;"{00000000-0000-0000-C000-000000000046}"
Data.l $00000000
Data.w $0000,$0000
Data.b $C0,$00,$00,$00,$00,$00,$00,$46
I'm using an ole enabled editorgadget into which I would like to dropprivate. Since olenabling appears to interfer with PB's native dragDrop processing, I'm very interested in learning how I can "intercept the drop" as referenced above.srod wrote:I can prevent the drop easily enough, - snip
My suspicion is that you will need to intercept the drop, open the file yourself and somehow stream the contents whilst converting to rtf format yourself!
I'll keep searching however.
Code: Select all
XIncludeFile "OLEedit.pbi"
OpenWindow(0,0,0,480,400,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
ListIconGadget(0,20,20,200,300,"Gadget 0", 195, #PB_ListIcon_FullRowSelect)
EditorGadget(1,250,20,200,300)
RichEdit_SetInterface(GadgetID(1))
AddGadgetItem(0, -1, "c:\test.txt")
AddGadgetItem(0, -1, "Beryl")
AddGadgetItem(0, -1, "Charles")
AddGadgetItem(0, -1, "Daniel")
AddGadgetItem(0, -1, "Ernest")
EnableGadgetDrop(1,#PB_Drop_Private, #PB_Drag_Move, 1)
Repeat
ev = WaitWindowEvent()
Select ev
Case #PB_Event_GadgetDrop
If EventDropType() = #PB_Drop_Private
Debug "Private drop " + Str(EventDropPrivate())
EndIf
Case #PB_Event_Gadget
If EventType() = #PB_EventType_DragStart
DragPrivate(1, #PB_Drag_Move)
EndIf
EndSelect
Until ev = #PB_Event_CloseWindow