delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/13/09:02:36

Date: Thu, 13 May 1999 16:00:13 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Edward F. Sowell" <sowelled AT home DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: GetShortPathName() or DLL support
In-Reply-To: <3739CF78.2D94EFE1@home.com>
Message-ID: <Pine.SUN.3.91.990513155951.12629J-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 12 May 1999, Edward F. Sowell wrote:

> MFC has a GetShortPathName() function that, obviously, converts a
> path with long file names, spaces, etc to the 8.3 format. This is
> often needed because some functions don't accept the funny file
> names... e.g., spawnxx().

You don't need this in DJGPP: when you call `spawnXX', the DJGPP
version automatically converts the long file name to the short one
before passing it to DOS.

> Is there an equivalent for DJGPP?

Not directly.  I think such a function is not needed; I never heard
about a use that would require a library function.  Do you know any
reason for it (`spawnXX' doesn't need it, as I explained above)?

If you really need such a function, use `__dpmi_int' to call function
7160h of Interrupt 21h with the value 1 in the CX register.  See Ralf
Brown's Interrupt List for the gory details.

> If not, can I link to a DLL (or static lib) created with MSVC++ that
> provides a C function wrapper for the MFC GetShortPathName?

DOS programs cannot call functions from DLLs, because Microsoft
doesn't want DOS programs to access useful features of Windows.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019