Solved

read a file on app launch [assosiated file]

Posted on 2003-10-26
6
151 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
Comment Utility
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
Comment Utility
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
Comment Utility
The question (or what it conveyed) is answered.
Would be happy to help if the author seeks further clarification.
0
 

Author Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now