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. ????
Who is Participating?
brother7Connect With a Mentor Commented:
See this article...

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.
fozyletConnect With a Mentor Commented:
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

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.
The question (or what it conveyed) is answered.
Would be happy to help if the author seeks further clarification.
themrocAuthor Commented:
sorry for the deley,
I got it working due to your help
I needed both contributions
therefore I split the points
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.