OLE Drag Drop |
Post Reply |
Author | |
DocItDev
Newbie Joined: 15 August 2011 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 15 August 2011 at 3:46pm |
We're currently in the process of migrating our VB6 code over to .Net, and we've run into a large difference between how the OLEDragDrop even was defined in VB6 and how it's defined in .Net.
Essentially the old VB6 event looks like this: Private Sub ReportControl1_OLEDragDrop(ByVal Data As XtremeReportControl.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single) while the .Net event looks like this: Private Sub RC1_OLEDragDrop(ByVal sender As Object, ByVal e As AxXtremeReportControl._DReportControlEvents_OLEDragDropEvent) Handles RC1.OLEDragDrop while your documentation says it should look like this: Public Event OLEDragDrop(ByVal Data As DataObject, ByRef Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long) Realistically, it doesn't matter how it actually looks, since most .Net DragDrop events look similar to how your OLEDragDrop event looks, what it really comes down to is the fact that your event doesn't seem to have any way to get at the DataObject associated with a DragDrop event that contains the information on what was dropped. Please assist. |
|
DocItDev
Newbie Joined: 15 August 2011 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
It's been two weeks, is there any information on this issue?
|
|
Orf
Newbie Joined: 29 September 2011 Location: Kirkland, WA Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Hey DocItDev,
I've been in the process of upgrading an internal project from VS2008 to VS2010 and ran into a similar 'interface-y' thing so I think I have the answer for you. 1. Instead of worrying about your project for a minute, create a new C# test application and go to the form designer. 2. In the designer's toolbox, right click and select Add Tab. Call it "CodeJock Controls". 3. Expand the tab and it should say there are no usable controls in the group (because we haven't added them yet.) 4. Right click in the tab and select "Choose controls", then go to COM Components and check every "Xtreme" checkbox so you get all the codejock stuff. Now you should be setup for C# Codejock work and here's where we'll start the DragDrop sample. 5. Drag the Xtreme Report Control onto the form, set the following parameters: Dock=Fill (just to make the sample nice) OLEDropMode=xtpOLEDropManual (needed for drag/drop) 6. In the events, double click in the value field of "OLEDragDrop" to automatically create the callback function for you. Here you should see that it has added one like this: private void axReportControl1_OLEDragDrop(object sender, AxXtremeReportControl._DReportControlEvents_OLEDragDropEvent e) Notice it's NOT the same as what you noted in your post. This is because .NET has written out the Ax*** interop wrapper class for the com control. What you're using is the XtremeReportControl.ReportControl and not the AxXtremeReportControl.ReportControl which returns a DragDrop interface of void OLEDragDropCallback(XtremeReportControl.DataObject Data, ref int Effect, short Button, short Shift, int x, int y). The Ax*** stuff makes the controls inherit from a Windows.Forms.Control object which is pretty key to using the com controls in C#. After all of that you should be able to read the list of files you dropped onto the control from explorer like this:
Does that help at all? |
|
DocItDev
Newbie Joined: 15 August 2011 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Thanks for the post Orf, but it doesn't really help.
The base Codejock event gives access to a collection of files dropped on to the control. Unfortunately for my needs I need both the possibility of a collection of files, and the possibility of a string (to cover both drag from the operating system, and to cover a drag from a non-Codejock control that is still inside of my application.) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |