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?
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?