Have you not tried OFN_NODEREFERENCELINKS? Of course, then you'll have to
dereference the shortcut yourself...
Ciao,
Dee
-----Original Message-----
From: BeginThread.com MSVC List [mailto:[EMAIL PROTECTED]]On Behalf
Of Palmer, Jean L.
Sent: Thursday, September 11, 2003 2:50 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [msvc] shortcut path
Thanks for your help, Phil, but you are completely frustrating me. As I
said, I am programatically opening a file using CFileDialog. It has nothing
to do with file extensions, where did you get that from?
Here, let me try again.
I have an .exe.
The .exe is written in Visual C++. The .exe, while running on Win2K, creates
a CFileDialog. The CFileDialog allows the user to pick a data file to open.
The data file which is opened is used to create a CDocument and a CView
representative of the data in the file.
When the file that the user chooses to open (from CFileDialog) is a SHORTCUT
to a data file, then the data file itself gets opened. The shortcut does
not get opened. All of the data seems to come directly from the data file,
not from the shortcut file.
If you look at the member variables of the CFileDialog after the user picks
the file to open(including its m_ofn member, and m_ofn.lpstrFile) it has
nothing to do with the shortcut! All of it has to do ONLY with what the
shortcut points to. The path that CFileDialog returns is NOT the path to
the shortcut, it is the path of what the shortcut points to. I don't know
how else I can say this to make it more clear. Maybe someone else can help?
-----Original Message-----
From: Phil Daley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 11, 2003 2:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [msvc] shortcut path
Oh, wait. Your are the registered owner of the extension?
Then you double click the shortcut?
Get the command line params. The command line has the path to the file.
>How does the exe open the shortcut?
>
>I must be missing something.
>
>
>At 9/11/2003 01:45 PM, Palmer, Jean L. wrote:
>
> >*I* know the path to the shortcut.
> >Any person opening the shortcut knows the path to the shortcut.
> >I want the .exe to know the path to the shortcut. I want to save it for
> >later use.
> >
> >
> >-----Original Message-----
> >From: Phil Daley [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, September 11, 2003 1:38 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: [msvc] shortcut path
> >
> >
> >At 9/11/2003 01:17 PM, Palmer, Jean L. wrote:
> >
> > >I am programatically opening a file though its file shortcut. I want
to
> > >know the path to that shortcut. The only thing I seem to be able to
get
> >is
> > >the path that the shortcut points to.
> >
> >You must have the name of the shortcut?
> >
> >What about GetPath? on the shortcut name?
> >
> >How do you open the shortcut, if you don't know it's path?
>
Phil Daley < AutoDesk >
http://personal.monad.net/~p_daley
