how to make openwith work?

Started by
0 comments, last by Xeee 21 years, 6 months ago
i have made a level editor for my game , it extension is .p3d what do i have to add to my application so that when i right click on a *.p3d file and choose openwith , and then choose my program , the level editor will open this file?? i don't mean the association with the extension from windows , i mean the part i should add to my level editor? thanks in advance xee.. [edited by - xeee on October 3, 2002 5:03:52 PM]
xee..
Advertisement
I believe that the command line (the LPCSTR variable passed to WinMain) would then contain the file that you opened. So, if your program is editor.exe and the file is level.p3d, the command line would look something like

C:\EditorPath\editor.exe C:\LevelPath\level.p3d

It's very similar to the int argc, char **argv you see in the main() arguments of console applications, except it's all one contiguous string. So, to process that, all you have to do is check the command line arguments for a .p3d filename, and if there is one, load it during initialization.

[edited by - Aprosenf on October 3, 2002 9:57:24 PM]

This topic is closed to new replies.

Advertisement