Solved

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

Posted on 2002-06-20
7
198 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

830 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