Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dbl click file - open with exe 1

Status
Not open for further replies.

MrFancyteeth

Programmer
Mar 18, 2003
90
GB
hello there,

I've created an exe & associated setup program which registers a custom filetype (filename.X9X)and associates them with my program with the default action of open. These files are essentially CSV files which my program exports and can view in a grid.

My client is really happy to have his own custom filetype but now wishes to double-click on the X9X files so they open the program and display in the grid.

Currently clicking a x9x file attempts to open the program but displays an error message of "No parameter statement found" which suggests to me there is a form method which is being passsed this filename as a parameter.

The assistance i require is how do i (or how does windows) pass the double clicked filename to the exe so i can use it? do i need code in the form init or startup.prg to collect this filename? in what form is the filename passed?

Mr Fancyteeth

p.s like the alias?
 
Hello Mr Fancyteeth,

I assume that, in the registration details for the file type, you have something like the following (this will be shown under "Application used to perform action" in the file types list in Folder Options):

"c:\MyPath\MyProg.Exe" "%1"

It is the "%1" which is the parameter. This is a place-holder for the filename, and it is this which is passed to your application.

To let your application receive the filename as a parameter, you need an LPARAMETER statement. If your main program is a PRG, this statement should be the very first one in the PRG. You can place comments before it, but no other code. If your main program is a form, you need the same statement, but it should appear in the Init of the form. Again, no other code should appear before it within ths Init.

Does that make sense? If I have misunderstood the question, get back and I'll try again.

p.s like the alias?
Better than most. Depends on what sense they are fancy, I suppose <g>.

Mike

Mike Lewis
Edinburgh, Scotland
 
Thanks,

it appears simple now,

the startup program - gets a parameter passed which is the filename.

Just need to work out filehandle stuff now.

Mr Fancyteeth

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top