• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

read a file on app launch [assosiated file]

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
themroc
Asked:
themroc
  • 2
2 Solutions
 
brother7Commented:
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
 
fozyletCommented:
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
 
fozyletCommented:
The question (or what it conveyed) is answered.
Would be happy to help if the author seeks further clarification.
0
 
themrocAuthor Commented:
sorry for the deley,
I got it working due to your help
I needed both contributions
therefore I split the points
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now