Assigning File Extensions and Using them

ImDaFrEaK

Well-known member
Joined
Jan 7, 2006
Messages
416
Location
California
Programming Experience
5-10
Sorry to ask for alot but I am self taught and this information is hard to find. I need to assign a certain file extension to my application. When the user clicks on this file type it will run in my application. Further; I need to know how to use this information in my application. How do I tell my application to use the file chosen to be started with it?

I apologize if this is too much but any help would be great. This includes books, links, or examples. Thankyou so much:)
 
Is this not the same thing to override the method and to handle the event? The event is forced with the mybase.onstartup. I don't see how this really dampers my application. However; I do understand what your saying. Also, the startupnextinstance, thanks. I havn't tried it yet but that sounds exactly like what I am looking for. Thanks again so much :)
 
Repeat of before: sorry I double posted. And thanx for the advice to use the event rather than. It is much wiser but for my position it's not making a big difference so I am using the IDE and intellisense to make things easier and quicker. Plus then I don't have to write the handler adn such. This is all I will be doing with it so I can't get it screwed up too bad, :) hehe.
 
You don't have to write the handler anyway. Just like in a form you select the object from the drop-down list at the top left and the event you wish to handle from the list on the right. The empty event handler is created for you.
 
Ok, I see now. This is pretty neat. See I havn't learned anthing about partial classes and I am assuming you can do that b/c this is a partial class. Normally a class can't handle it's own events. Is this correct? I need to read some MS dosumentation on Partial Classes and what not from 2003 to 2005. I will prob do that now. Thanks again man :)
 
ImDaFrEaK said:
Also, I did build and deploy the application b/c I am assuming you can't test this feauture in the IDE and have to test it as installed.
Way late for a reply since you got it working and moved on, still I have a comment for the quote. You can easily test commandline arguments for an application without setting up file associations and deploy. Just run your application exe from command prompt and supply some arguments for testing, this works the same as through the automatic association and you will see how (and if) the application handles arguments properly on startup. For instance:
myapplication.exe /argument1 -argument2 "hello here"
This should be able to read the three supplied commandline arguments for testing.
 
Way over my head but I am all ears, or eyes. Please give a lil more detail on associating the file extension during testing. Basically, I add an Install Project to my current project and assiciate the file with the install, so I really have no code for it; if that is what you are doing.

However; I am really anxious and willing to learn if you have any more information to share. I appreciate it all too, thank you so much, all of you.
 
That's exactly the point, you don't use file association to test. Just run the executable with an argument and see if the application can handle it. If "command prompt" is a barrier for you, you can always make a windows shortcut that runs the application with an argument.
 
Back to this again. I have a huge problem that I have dealt with for a while but now I'm upset with it. When I first started doing this I had my program running when double clicking yet no file association. Well, I learned how use the CommandLine Object and all and now the problem is when I DoubleClick an associated file I get a DialogBox from windows Titled "Open With" and it states. "Choose the progam you want to use to open this file" MY default options are RealPlayer and my Player (this is an mp3 file). I choose my player and I even check the box in windows to "Always use the selected program to open this type of file" and yet everytime I doubleclick an mp3 file I get that dialogbox. When I select my player it operates fine. Opens the song and plays it, I get the same results if the player is already running.... what do I do?
 
Ok, never mind. I got it working for now but I'm not sure why. I had renamed the &Open to &Start with G3 Player. I guess this altered something in the registry. Maybe &Open is needed. Anyways, its working.
 
Back
Top