Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - OLE Drag Drop
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

OLE Drag Drop

 Post Reply Post Reply
Author
Message
DocItDev View Drop Down
Newbie
Newbie


Joined: 15 August 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote DocItDev Quote  Post ReplyReply Direct Link To This Post Topic: OLE Drag Drop
    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.
Back to Top
DocItDev View Drop Down
Newbie
Newbie


Joined: 15 August 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote DocItDev Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2011 at 9:25am
It's been two weeks, is there any information on this issue?
Back to Top
Orf View Drop Down
Newbie
Newbie
Avatar

Joined: 29 September 2011
Location: Kirkland, WA
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Orf Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2011 at 5:22pm
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:

        private void axReportControl1_OLEDragDrop(object sender, AxXtremeReportControl._DReportControlEvents_OLEDragDropEvent e)
        {
            for(int x = 1; x < e.data.Files.Count + 1; x++) // OLE stuff is indexed off 1 and not 0.  :(
            {
                Debug.WriteLine("File: " + e.data.Files[x]);
            }
        }


Does that help at all?
Back to Top
DocItDev View Drop Down
Newbie
Newbie


Joined: 15 August 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote DocItDev Quote  Post ReplyReply Direct Link To This Post Posted: 11 October 2011 at 2:41pm
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.)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.