Archived

This topic is now archived and is closed to further replies.

Xeee

how to make openwith work?

Recommended Posts

Xeee    144
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]

Share this post


Link to post
Share on other sites
Aprosenf    372
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]

Share this post


Link to post
Share on other sites