Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DragDropMode drProgrControlVB (Read 4788 times)
baron
YaBB Newbies
*
Offline


1001001001

Posts: 42
Joined: Dec 2nd, 2007
DragDropMode drProgrControlVB
May 10th, 2012 at 1:22pm
Print Post  
Hello,

I tried to implement OLE drag & drop functionality from another component into the FlowChartX component. It all works well until I actually have to get the data out of the DataObject. I.e.

Private Sub Chart_DragOverBoxVB(ByVal box As FLOWCHARTLibCtl.IBoxItem, ByVal dataObj As FLOWCHARTLibCtl.IVBDataObject, ByVal docX As Long, ByVal docY As Long, ByVal keyState As Long, effect As Long)
If Not dataObj.GetFormat(ClayClipBoard) Then
effect = 0
Exit Sub
End If
Call dataObj.GetData(ClayClipBoard)


The GetFormat returns true, but GetData returns Empty. This also happens even if I use text format (vbCFText instead of my custom format 'ClayClipBoard')

I know it isn't empty because if I drag it onto another of my components, the GetData works fine there.

Also I am using FlowChartX v4.2
Is this a bug that has been fixed by any chance? Or am I doing something wrong?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DragDropMode drProgrControlVB
Reply #1 - May 10th, 2012 at 4:15pm
Print Post  
Hello,

IVBDataObject supports only standard clipboard formats that the control knows how to convert to corresponding VB types. This includes strings, pictures, files and FlowchartX items. Custom clipboard formats are not supported in ProgrControlVB mode at this time. vbCFText format should work - you can see it demonstrated along with ProgrControlVB mode in the "More Drag&Drop" sample project.
  
Back to top
 
IP Logged
 
baron
YaBB Newbies
*
Offline


1001001001

Posts: 42
Joined: Dec 2nd, 2007
Re: DragDropMode drProgrControlVB
Reply #2 - May 10th, 2012 at 6:46pm
Print Post  
Well I tested text and that didn't work either - I got 'Empty'. I'll check out the sample project in a couple of days when I get back and see if that works...

The problem with using text is that I wanted to differentiate it from other OLE drag objects somehow. It works perfectly with all the other components in my app except the chart and I'd rather not redo all my code just for the chart. The custom clipboard format is a simple byte array...
  
Back to top
 
IP Logged
 
baron
YaBB Newbies
*
Offline


1001001001

Posts: 42
Joined: Dec 2nd, 2007
Re: DragDropMode drProgrControlVB
Reply #3 - May 13th, 2012 at 8:38am
Print Post  
OK text works - I don't know why it didn't work last time. I guess I can use text with a unique identifier prefix but obviously this isn't ideal.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DragDropMode drProgrControlVB
Reply #4 - May 14th, 2012 at 11:32am
Print Post  
Our developer tried reusing the flowchart's DataObject.GetData method to return a byte array as VARIANT of SAFEARRAY of bytes, but VB shows an "Automation type not supported" error. Could you post some sample code showing how are you reading the byte arrays from your other controls? If possible please copy the IDL method definition shown by OLE/COM Object Viewer tool.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint