Re: file associations / positional arguments

Eric Mullins <[email protected]>
Newsgroups gmane.comp.gnu.xboard.devel
Message-ID <[email protected]>
Back when I wrote MFC stuff, you could ship a .reg file and then invoke 
CWinApp::RegisterShellFileTypes during initialization.  This method
doesn't seem to work with recent windows because lacking admin privs,
everything outside of HKCU would not be modified.

However, that's really what you need to do-- add the proper registry 
entries at runtime to make associations work right.  Usually the 
installer does that, but lacking an installer, the program has to do it 
if you want that functionality.

On 9/19/2012 1:51 AM, h.g. muller wrote:
> I had to make one backward-compatibility breaking change to make this
> work satisfactorily.
> Problem is that Windows filenames often do contain spaces, and that the
> OS, when you
> use the "Open with..." menu item on a document, is not so friendly as to
> quote this filename.
> So WinBoard will be confronted with command lines like
>
>    winboard.exe Candidate Matches.pgn
>    winboard.exe KingCheck ICS.xsf
>
> The existing code would then complain that Matches.pgn was an invalid
> option (as only a single
> positional argument would be accepted), and even if it survived that,
> its attempts to open the
> file Candidate would likely come to nothing.
>
> So I now made it such that when reading the value of a positional
> argument, spaces are not
> considered a termination character, but are considered part of the arg
> value. This, however,
> would break a usage like
>
>    winboard.exe games.pgn -ncp
>
> which in the old system would be parsed like
>
>    winboard.exe -lgf games.pgn -ncp
>
> but now would be interpreted as
>
>    winboard.exe -lgf "games.pgn -ncp"
>
> Is there any legitimate of such a mixture of position arguments and
> regular command-line options?
> And even if there is, should we continue to support it?
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.