Opening files from explorer.

I have associated the extention .vip to my program Viper.exe. However, I have no idea how to make the program open the .vip file that has been opened in explorer! How do you find out which file was double clicked to open the filw.

Thanks in advance.




Answer this question

Opening files from explorer.

  • snorlaxnet

    Hiya wrote:

    To be honest, I don't even know what native code is, apart from it is probably better as it works without the .NET Framework. I only know managed and started creating programs a few months ago with Visual C++ Express Edition Beta 2 Whitby thing and haven't learnt native.

    Yes, I would like it in managed code, a least until I find somewhere to learn native code.

    Okay, then use Environment::CommandLine - this will return the full command line for your app. Or use Environment::GetCommandLineArgs - which will return a String array which may be easier for you.



  • shi2008

    Hiya wrote:

    I have associated the extention .vip to my program Viper.exe. However, I have no idea how to make the program open the .vip file that has been opened in explorer! How do you find out which file was double clicked to open the filw.

    Thanks in advance.

    It will normally be the first command line argument passed to the executable.



  • John Placais

    You need to set some entries in the registry to inform the shell, that your program is respnsible to handle OPEN requests for this file extension.

    http://www.codeproject.com/shell/cgfiletype.asp



  • aosman

    Are you using native code or managed code From your sig, it looks like you only do managed code, but could you clarify that please

    Hiya wrote:

    Reply 1:-

    Can you please tell me how to find out the first argument of the command line.

    Reply 2:-

    I am really have problems with exaple from http://www.codeproject.com/. They use some random type of VC++ that isn't ANSI C++ or the .NET Framework. Whatever it is it doesn't work in Visual Studio 2005. Can you either tell me how to make it work in Visual Studio 2005 or show me something different.

    Thanks for the help anyway.



  • e-networld

    To be honest, I don't even know what native code is, apart from it is probably better as it works without the .NET Framework. I only know managed and started creating programs a few months ago with Visual C++ Express Edition Beta 2 Whitby thing and haven't learnt native.

    Yes, I would like it in managed code, a least until I find somewhere to learn native code.



  • ICR

    Reply 1:-

    Can you please tell me how to find out the first argument of the command line.

    Reply 2:-

    I am really have problems with exaple from http://www.codeproject.com/. They use some random type of VC++ that isn't ANSI C++ or the .NET Framework. Whatever it is it doesn't work in Visual Studio 2005. Can you either tell me how to make it work in Visual Studio 2005 or show me something different.

    Thanks for the help anyway.



  • Opening files from explorer.