|
-
Jun 17th, 2000, 03:07 AM
#1
Thread Starter
Frenzied Member
I'm writing a text viewer program.
I need to ascociate my program with the filetype *.log.
How do I do this, and I how can I make it load the contents of the
.log file into my RichTextBox (File)
-
Jun 17th, 2000, 03:36 AM
#2
Lively Member
Right then...
First of all, do you want to associate the file type through code or through manual means? (I am thinking it is for use on like 1 machine?!?)
The manual way is easier... Just compile your program (after sorting all the COMMAND() stuff out... refer to bottom or this post for more info), then go to a folder and go to VIEW >> Folder Options then click on the File Types tab.
Next scroll down until you find the file type .log and click on edit. Next select "open" from the actions list and click edit. Next, use the browse dialogue to select your program, or, type in the exact path to your program.
Right. This will open your program every time someone opens a log file, but you need to get the command line parameters that are passed to your program when a log file is opened.
To do this, u need to use COMMAND() to retrieve the command line parameters that were passed to your app. I don't know how to use COMMAND(), but it has been detailed on this board loads, so just do a search for it.
From the Command() function, you should then be able to get the filename of the file that needs to be opened, and then you can subsequently load it into your text box.
Hope this helps 
Laterz
REM
-
Jun 17th, 2000, 04:03 AM
#3
Thread Starter
Frenzied Member
I want to ascociate through code, and I want my program to open and put the content of the file into a richtextbox whenever i click on a .log file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|