Solved

How to Ole Drag/Drop image files to a 3rd party program?

Posted on 2002-06-20
7
197 Views
Last Modified: 2010-05-02
On a VB6 form I have a File1 control listing multiple .JPG files.  In File2 on the same form I have a 3rd party image printing program that will accept OleDragDrop (I've tested it with Explorer, dropping up to five images on it).

I would like to multiselect files from File1 then drag them to the .EXE shown in File2 and drop them, which should have the same effect as working within Explorer, launching the program with the files loaded inside.

It seemed simple until I began and now I need lots of help.

ADDITIONAL CLARIFICATIONS:

The process I need to do is to drag and drop multiple files onto a 3rd party program so that the 3rd party program accepts the files and launches.

This would be similar to having two instances of Explorer open, one pointing to a folder with .JPG files in it and the other instance pointing to a 3rd party .JPG printing program.  Another example would be one Explorer showing .BMP's and the other Explorer showing MS Paint.  Click and drag the .BMP and drop it on the MS Paint program and it will not only launch MS Paint but MS Paint will have the .BMP displayed when it is opened.

I am attempting to do this with a more friendly interface than two instances of Explorer, using the VB Controls File1 and File2.

MORE:
Is it possible to have two instances of Explorer (like a control) within my VB6 project so that the drag and drop onto them and thereby the 3rd party program would be automatic?

Can anybody help?
0
Comment
Question by:rrorison
7 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7097780
i have something...let me see...
0
 
LVL 5

Expert Comment

by:rpai
ID: 7098706
Take a look here.
http://pages.cpsc.ucalgary.ca/~saul/vb_examples/tutorial11/imagedrag.html
This might help you code for your requirement.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7098872
try this (it was done with a picture box so you have to do some changes):

VERSION 5.00
Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   3600
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6180
   LinkTopic       =   "Form1"
   ScaleHeight     =   3600
   ScaleWidth      =   6180
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1
      Caption         =   "&Select folder"
      Height          =   435
      Left            =   4380
      TabIndex        =   2
      Top             =   3060
      Width           =   1635
   End
   Begin VB.FileListBox File1
      Height          =   2820
      Left            =   60
      Pattern         =   "*.jpg"
      TabIndex        =   1
      Top             =   120
      Width           =   2475
   End
   Begin VB.PictureBox Picture1
      AutoSize        =   -1  'True
      Height          =   2775
      Left            =   2700
      ScaleHeight     =   2715
      ScaleWidth      =   3315
      TabIndex        =   0
      Top             =   120
      Width           =   3375
   End
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      Height          =   195
      Left            =   2160
      TabIndex        =   3
      Top             =   3600
      Width           =   480
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()

With File1
    .Path = BrowseForFolder(Me.hWnd, "")
    .Pattern = "*.jpg;*.gif"
End With
End Sub


Private Sub File1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Label1
    .Caption = File1.Path & "\" & File1.FileName
    .Drag vbBeginDrag
End With
End Sub


Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
Picture1.Picture = LoadPicture(Label1.Caption)
End Sub
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:rrorison
ID: 7105348

RESPONSES

To rpai:

While the link you provided did indeed have notations regarding drag and drop as a process on a VB project, the referenced link focused primarily on image to image controls.  My original question asked for help regarding multiple image files and ole drag and drop to a 3rd party software program.

To Richie_Simonetti:

As I noted above, my original question did not refer to ole drag and drop from the File1 control to an image control, but for multiple image files being dropped onto a software program, File1 to File2 and have that program launched.


At this time I am requesting to have this question removed so no further Comments or Suggestions should be registered.

My thanks to those who spent time to provide these suggestion.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7105398
i didn't use OleDrag!
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7923703
Hi rrorison,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

rrorison, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7968429
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question