File types, and open specified file type 
Author Message
 File types, and open specified file type

Hi!
I don't know how to formulate this exactly, but here is the problem:

You all know that when you register a new file type, it suppose to be
opened with an application.
Let's say I've made a text editor. I don't use usual .txt extention, but i
specify my own, new extention, let's say .RRR. Then I associate this
file type with my app in Windows - File Types window.
Everything goes well, until I doubleclick on the file.
Application opens, but no file loads. I have to load it manualy.
Why?
Did I miss something, or it just so that I have to add special code
to my app, to make this work?
Thaks for your answers.
Diman



Thu, 22 Feb 2001 03:00:00 GMT  
 File types, and open specified file type
When registering the file extension, you must enter under 'open':
'^c:\yourapp.exe %1' then the app gets the filename as parameter.
Ciao
Stefan


Thu, 22 Feb 2001 03:00:00 GMT  
 File types, and open specified file type
In your Main(), you have to use the variable Command$ to get the file
name and any switches.

--
-------------------------------
     ---==Fester==---

     "Microsoft has done nothing illegal."
     "The average user is computer-illiterate"
     "Anything proprietary is bad."


     Webmaster of:      http://www.mchenryinc.com/
====================================================


Quote:
>Hi!
>I don't know how to formulate this exactly, but here is the problem:

>You all know that when you register a new file type, it suppose to be
>opened with an application.
>Let's say I've made a text editor. I don't use usual .txt extention,
but i
>specify my own, new extention, let's say .RRR. Then I associate this
>file type with my app in Windows - File Types window.
>Everything goes well, until I doubleclick on the file.
>Application opens, but no file loads. I have to load it manualy.
>Why?
>Did I miss something, or it just so that I have to add special code
>to my app, to make this work?
>Thaks for your answers.
>Diman



Thu, 22 Feb 2001 03:00:00 GMT  
 File types, and open specified file type

Quote:

> You all know that when you register a new file type, it suppose to be
> opened with an application.
...
> Everything goes well, until I doubleclick on the file.
> Application opens, but no file loads. I have to load it manualy.

You do need to tell the program to read the command line when it starts
up.  The function command$ returns all the arguements to the program.
In your case it would return q:\path\to\MyText.rrr.  

Regards,
Thom



Thu, 22 Feb 2001 03:00:00 GMT  
 File types, and open specified file type
Did you check upon program loading whether or not the Command$ contained
any parameters to pass to the program?

Example:
Sub Form_Load()
    If Command$ <> "" Then
        Open Command$ for Input as #1
        ...more code...
        ...even more core...
    End If
End Sub

Joe in Texas.

Quote:

> Hi!
> I don't know how to formulate this exactly, but here is the problem:

> You all know that when you register a new file type, it suppose to be
> opened with an application.
> Let's say I've made a text editor. I don't use usual .txt extention, but i
> specify my own, new extention, let's say .RRR. Then I associate this
> file type with my app in Windows - File Types window.
> Everything goes well, until I doubleclick on the file.
> Application opens, but no file loads. I have to load it manualy.
> Why?
> Did I miss something, or it just so that I have to add special code
> to my app, to make this work?
> Thaks for your answers.
> Diman



Sat, 24 Feb 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. opening a file with the default app for that file type

2. Opening a file using file type association

3. File-Open with problem...concerning file types

4. Saving open file and opening new file at a specified time of day

5. A File Open type dialog box

6. Show multiple file types to open?

7. Howto register a File Type to get opened with my VB5 App in Explorer

8. Register File Type and getting it to Open???

9. Opening all files of a type in a directory

10. . : : Opening file types : : .

11. trying to open a file of unknown type

12. Opening a file of unkown type error - re: activex docs

 

 
Powered by phpBB® Forum Software