Hi,
I'v written (wxWidgets)application program in windows platform, which will read the content of a input file(for eg,txt) specified by user and do some processing .
My Requirement:
when i double click the input file it has to trigger the aplication program and has to do the processing .
Note:
I'v associated the input file with my appliction simply through choose program dialog, so when i double click
input file is triggering the exe .
Is there any way to get the input file path within myapp::OnInit() , so that i can get the input data to proceed with.
Associating a file with my application - Reg
Associating a file with my application - Reg
Every exit is an entry somewhere else!
-
- Earned some good credits
- Posts: 122
- Joined: Fri Apr 14, 2006 9:49 pm
- Location: Beaverton, OR
- Contact:
Setting a file association is not normally done from within a program. It's more common to set file associations using the installer. For instance, I use InnoSetup for my Windows installs, and in one part of that install process I set registry entries that associate file types with my app.
If you're curious about that method, you can look here:
http://www.jrsoftware.org/isfaq.php#assoc
I suppose you could always modify the registry entries in code, but that's bad form because when your app is uninstalled the file associations don't go away.
If you're curious about that method, you can look here:
http://www.jrsoftware.org/isfaq.php#assoc
I suppose you could always modify the registry entries in code, but that's bad form because when your app is uninstalled the file associations don't go away.
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]
rajan_m, you can use the argc and argv (wxApp members):
Code: Select all
bool myApp::OnInit(){
wxString filename;
if (argc == 2){ // Check if there is just one argument
filename = argv[1];
// do processing
}else{
// use the open file dialog
}
}
_________________________
Matheus de Oliveira
Matheus de Oliveira