?
Solved

read a file on app launch [assosiated file]

Posted on 2003-10-26
6
Medium Priority
?
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
brother7 earned 520 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 400 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses
Course of the Month9 days, 20 hours left to enroll

762 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