NewsArchive
05-30-2008, 01:26 AM
Hi Friedrich,
Guess I'll have to continue the argument<g>
I've run into a problem again with the argument option for the file
association.
I changed my program to accept "%1" as the first parameter and that
would contain the filename. No problems but now I need to add a
SECOND argument to the command line in the file association. So I
added %2 to the "Arguments" field, thinking this would get me the "%1"
%2 that I needed. But this gets created into the registry as:
"C:\Program Files..." %2 "%1"
I.e. the entered arguments are placed BEFORE the default "%1"
argument.
When I use the shell to create a shortcut it places the arguments at
the END of the command line, like:
"Myproject.aprj" /E
If I change the association to "%1" %2 everything works fine with my
shortcuts as it should.
So it seems that I'm hosed doing this unless I modify the registry
key.
I'm using the IShellLink to create the shortcut:
psl->SetPath(lpszPathObj);
psl->SetDescription(lpszDesc);
if(lpszArg!=NULL){
psl->SetArguments(lpszArg);
}
and this is working without problems, but the SetArguments() places
any additional arguments after the SetPath() value.
Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com
Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php
Guess I'll have to continue the argument<g>
I've run into a problem again with the argument option for the file
association.
I changed my program to accept "%1" as the first parameter and that
would contain the filename. No problems but now I need to add a
SECOND argument to the command line in the file association. So I
added %2 to the "Arguments" field, thinking this would get me the "%1"
%2 that I needed. But this gets created into the registry as:
"C:\Program Files..." %2 "%1"
I.e. the entered arguments are placed BEFORE the default "%1"
argument.
When I use the shell to create a shortcut it places the arguments at
the END of the command line, like:
"Myproject.aprj" /E
If I change the association to "%1" %2 everything works fine with my
shortcuts as it should.
So it seems that I'm hosed doing this unless I modify the registry
key.
I'm using the IShellLink to create the shortcut:
psl->SetPath(lpszPathObj);
psl->SetDescription(lpszDesc);
if(lpszArg!=NULL){
psl->SetArguments(lpszArg);
}
and this is working without problems, but the SetArguments() places
any additional arguments after the SetPath() value.
Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com
Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php