Solved

how to pass some file loaded by association?

Posted on 2002-04-09
6
188 Views
Last Modified: 2012-05-04
Im making a program like winamp for my car that play mp3 files. And the question is: How can i pass the name of the file that I select in the Windows Explorer??

I can make the association in windows but always start a new copy of my program, the I use COMMAND to obtain the arguments (in this case the file name). But how can i program something like "Enqueue in Winamp" to my application??. The idea is that when I doble-clic in a file that name pass to my program to enqueue in my program??

thankx,
and sorry about my bad english
0
Comment
Question by:zucos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:zucos
ID: 6929508
not starting another copy of my program.. just using the program currently opened.
0
 
LVL 1

Expert Comment

by:COAtheGREAT
ID: 6929608
set project type to ActiveX EXE
and start mode as Standalone

for the bigining :)
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6929618
In project/options change startup from "form1" to "Sub Main"

Sub Main()
    Dim OldTitle$

    If App.PrevInstance Then
        OldTitle = App.Title
        AppActivate OldTitle
        End
    End If

    Form1.Show
End Sub

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Accepted Solution

by:
bhess1 earned 200 total points
ID: 6929633
Have your application look for a previous instance of your app already running.  If it finds one, pass the information to that app and terminate.

There is a sample app that does just that here:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=22061&lngWId=1

and here

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=28394&lngWId=1
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6929679

U can make a server-client application ie

1- U can compile Ur program as an activex exe (not standard exe) making a public proc in its class module (not a form ) this public proc  will get Ur string and pass it to the form this will be server app

2- then maka another small prog refering to the first one
(in project - references refer to Ur compiled exe)

3- inside client module call server module procedure
0
 

Author Comment

by:zucos
ID: 6929689
thankx to everyone.
the answer of bhess1 solve my problem.

thankx for answering that fast
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

730 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