🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13477

Re: Short/Long pathname

#13477
From: dude
Date: Fri, 10 Oct 2003 13:12
38 lines
2181 bytes
Thank You Remy

-- 
James Porter
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:3f85c3fc$1@newsgroups.borland.com...
>
> "dude" <bendixdude@yahoo.com> wrote in message
> news:3f85c1b4$1@newsgroups.borland.com...
>
> > LPCTSTR lspFilename;
> > LPTSTR spFilename;
> > unsigned long buffer;
> > ::GetShortPathName(lspFilename,spFilename,buffer);
>
> You are not using GetShortPathName() correctly.  You need to pass in a
> pre-allocated buffer to accept the short filename, GetShortFileName() will
> not allocate the buffer for you.  It should be more like this instead:
>
>     TCHAR spFilename[MAX_PATH+1] = {0};
>     ::GetShortPathName("the long file name here", spFilename,
> sizeof(spFilename));
>
> > This is to convert for the shellexecute command because
> > that will bomb as well, given a long file name.
>
> No, it will not bomb on LFNs.  However, if you are concerned about it, you
> could just pass the filename as part of the lpApplicationName parameter
> instead of the lpCommandLine parameter, that way you can surround the
> filename with extra quotation marks:
>
>     ::ShellExecute(NULL , "open", "EXCEL.EXE \"the long file name here\"",
> NULL, 0, SW_SHOW);
>
>
> Gambit
>
>
Technical Details
Message-ID: <3f86aea5$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f85c1b4$1@newsgroups.borland.com> <3f85c3fc$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,d208aa5f5b67a796
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-10 06:09:31 PST
From: "dude" <bendixdude@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f85c1b4$1@newsgroups.borland.com> <3f85c3fc$1@newsgroups.borland.com>
Subject: Re: Short/Long pathname
Date: Fri, 10 Oct 2003 09:12:51 -0400
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 12.46.189.1
Message-ID: <3f86aea5$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1065791141 12.46.189.1 (10 Oct 2003 06:05:41 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail