Solved

how to pass some file loaded by association?

Posted on 2002-04-09
6
185 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

861 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now