Solved

how to pass some file loaded by association?

Posted on 2002-04-09
6
184 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

14 Experts available now in Live!

Get 1:1 Help Now