Officially An Architect
You create a file extension association in the registry which links the file extension to your application. When somebody double clicks on a file, Windows will launch your application using the command line "myapp.exe <the file>". It's up to your app to process the command line argument to get the filename to use.
This has nothing to do with C++ and everything to do with Windows (or whatever operating system you're using).
Originally Posted by Need_O2