Solved

read a file on app launch [assosiated file]

Posted on 2003-10-26
6
154 Views
Last Modified: 2010-05-03
I created a app which stores calcualted values in a so called *.hit file.

Now I created an assosiation from my programme to this file extention. So every time the *.hit file is doubleclicked the application starts.

Now my problem I would like that the app starts and that it automatically startes to open the doubleclicked file and read the data into the application.

How do I have to code this. ????
0
Comment
Question by:themroc
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
brother7 earned 130 total points
ID: 9623717
See this article...
http://www.codeguru.com/vb_system/FileAssociate.html

From the above-mentioned article:
"Your application must inspect the command line parameters passed to it in the startup module; then accordingly load the file. To access the command line parameters passed to your application, you should inspect the value of Command$ in your startup module. The following code snippet demonstrates this."

Hope that helps.
0
 
LVL 8

Assisted Solution

by:fozylet
fozylet earned 100 total points
ID: 9623718
When you double-click the .hit file and launch the application, the filename of the .hit file will come in as a command-line parameter.
You can access this as Command

i.e.
myFile=Command
fp = FreeFile
Open myFile For Input As fp
'... do operations
Close fp

that is for read. you can open for Append/Output as the requirement may be.
0
 
LVL 8

Expert Comment

by:fozylet
ID: 10216738
The question (or what it conveyed) is answered.
Would be happy to help if the author seeks further clarification.
0
 

Author Comment

by:themroc
ID: 10350558
sorry for the deley,
I got it working due to your help
I needed both contributions
therefore I split the points
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
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…

856 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