🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: CreateProcessAsUserW and quoted path names...

#143
From: Bob Gonder
Date: Sun, 15 Jun 2008 20:26
22 lines
1735 bytes
Mike Collins wrote:

>5) CreateProcessAsUserW();
>
>- until today, this code was working fine.  However, CreateProcessAsUser has 
>started to return an error code, 123, The filename, directory name, or 
>volume label syntax is incorrect.  The second parameter (lpApplicationName) 
>to this call is created thus:
>
>WideString wzAppName = (WideString)("\""+Utils->getControlCentreExePath()+"\"");

What type does getControlCentreExePath() return?
You are adding two narrow strings to it, and
lying about the result being a wide string.

Might work better if you use all wide string, or all normal string.

WideString wzApp = "\""L + Utils->getControlCentreExePathW() + "\""L;
CreateProcessAsUserW( ,wzApp.c_bstr(),);

String szApp = "\"" + Utils->getControlCentreExePathA() + "\"";
CreateProcessAsUserA( ,szApp.c_str(),);
Technical Details
Message-ID: <k3ua5456b2t0gdnnc6mmdm0hn2tm6crosr@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4855474a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a169c88c9ed98680
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <none@nowhere.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: CreateProcessAsUserW and quoted path names...
Date: Sun, 15 Jun 2008 13:26:48 -0700
Message-ID: <k3ua5456b2t0gdnnc6mmdm0hn2tm6crosr@4ax.com>
References: <4855474a@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.144.12
X-Trace: newsgroups.borland.com 1213561607 67.77.144.12 (15 Jun 2008 13:26:47 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail