Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages
Started by Mike K
Wed, 12 Dec 2007 22:14
TILDE-ONE file names ?
Author: Mike K
Date: Wed, 12 Dec 2007 22:14
Date: Wed, 12 Dec 2007 22:14
29 lines
1997 bytes
1997 bytes
I have two instances of 8.3 filenames vexing me.
First: why does this call work:
r = spawnl(P_WAIT, "c:\\windows\\system32\\rundll32.exe",
"c:\\windows\\system32\\rundll32.exe","C:\\PROGRA~1\\COMMON~1\\system\\OLEDB~1\\oledb32.dll,OpenDSLFile
c:\\temp.udl",NULL);
but this one does not?
r = spawnl(P_WAIT, "c:\\windows\\system32\\rundll32.exe",
"c:\\windows\\system32\\rundll32.exe","C:\\Program files\\Common
Files\\system\\Ole DB\\oledb32.dll,OpenDSLFile c:\\temp.udl",NULL);
The 'old' "C" calls to spawnl can't handle arguments with embedded
spaces in spite of the enclosing quotes?
Second:
I have an Activex Server EXE with a long filename
("NMSService_AlarmService.exe") that displays its full name on the
Processes tab on Windows Task Manager. The same exe, when I load and
run it on a customer machine, shows "NMSServ~1.exe" in the TM. This is
a problem for me because I have a suite of these services that all have
long filenames that start with "NMSService_". Is this a locale setting
on the remote machine? Anyone have any idea? Thanks for any help.
Mike
Re: TILDE-ONE file names ?
Author: Remy Lebeau (TeamB)
Date: Wed, 12 Dec 2007 23:35
Date: Wed, 12 Dec 2007 23:35
56 lines
3402 bytes
3402 bytes
"Mike K" <nospam@nospam.net> wrote in message
news:47605d31$1@newsgroups.borland.com...
> First: why does this call work:
<snip>
Because it is using 8.3 naming that do not have any embedded spaces inside
the folder/file names.
> but this one does not?
<snip>
Because that one is not using 8.3 names, and the folder/file names have
spaces in them. When spaces are present, You have to wrap such names in
quotation marks, otherwise the system will interpret the spaces as parameter
delimiters instead, ie:
r = spawnl(P_WAIT, "c:\\windows\\system32\\rundll32.exe",
"c:\\windows\\system32\\rundll32.exe", "\"C:\\Program files\\Common
Files\\system\\Ole DB\\oledb32.dll\",OpenDSLFile c:\\temp.udl", NULL);
> The 'old' "C" calls to spawnl can't handle arguments with embedded spaces
> in spite of the enclosing quotes?
You are not using enclosing quotes. You are only using quotes that are
required by the C++ language syntax to indicate string literals, but the
*contents* of those literals need their own embedded quotes when passing LFN
path/file names with spaces in them as command-line parameter to a new
application process. Not even the Win32 API WinExec(), ShellExecute(), and
CreateProcess() functions can handle embedded spaces in their filename
parameters without using embedded quotes. This is not a general string
handling requirement. It is specific to launching a new process, as the
underlying command interpreter uses spaces as a delimiter between
command-line parameters for the new process. So there had to be a way of
allowing parameters with embedded spaces that were not treated as
delimiters, hense the extra set of quotes that are needed. You have to do
the same thing when typing commands at the DOS command prompt.
> I have an Activex Server EXE with a long filename
> ("NMSService_AlarmService.exe") that displays its full name
> on the Processes tab on Windows Task Manager.
> The same exe, when I load and run it on a customer machine,
> shows "NMSServ~1.exe" in the TM.
That happens if you use an 8.3 filename to spawn the new process. It also
depends on which OS version you are using, as not all versions are spart
enough to automatically convert a 8.3 name to a LFN name.
> This is a problem for me because I have a suite of these services
> that all have long filenames that start with "NMSService_".
That is not a problem at all.
Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads