LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Drag and drop files

Is it possible to drag files from programs such as Windows Explorer into my user interface (e.g. in a text string box)?  The goal is to display the filename in the text string box. According to the help files the EVENT_DRAG and EVEND_DROP events are only valid for trees and splittersSmiley Sad
 
0 Kudos
Message 1 of 7
(3,655 Views)
Try looking in the Programmers Toolbox (Library->Programmer's Toolbox->Drag-And-Drop).Smiley Wink
0 Kudos
Message 2 of 7
(3,641 Views)
Thanks for the tip. I'll try it immediately.
0 Kudos
Message 3 of 7
(3,636 Views)
Hello JR,
 
I'm having another problem now.  I enabled drag and drop on the panel. When the panel callback is called with the EVENT_FILESDROPPED event, eventData1 should contain an array of strings of the filenames (according to the Help file). Problem is: eventData1 is an integer. How can I convert this to an array of strings. I already tried some things such as:
 
char
0 Kudos
Message 4 of 7
(3,626 Views)
(sorry, i wasn't ready yet)
 
char *p_filelist;
 
p_filelist = eventData1;
 
But whatever i trie i get compiler errorsSmiley Sad
0 Kudos
Message 5 of 7
(3,624 Views)

Keeping things simple by assuming you are just dropping the one filename, how about:

char filename [MAX_PATH_LEN];

and then:

strcpy (filename, (char *) eventData1);

The cast should stop your compiler errors.

JR

0 Kudos
Message 6 of 7
(3,621 Views)
It works fine now. thanks a lot JR.
0 Kudos
Message 7 of 7
(3,618 Views)