SalLoadApp max length ?

Report bugs and possible workarounds for ANSI TD versions
Ren

SalLoadApp max length ?

Post by Ren » 01 Oct 2008, 06:12

Is there a maximum length of 256 characters for SalLoadApp() calls ? (with one reserved for the space which goes between executable and arguments)

Can be tested simply with:

Code: Select all

 Call SalLoadApp ( 'C:\\program files\\internet explorer\\iexplore.exe' , SalStrRepeatX ( 'x',207) )
 !  --> works.
 Call SalLoadApp ( 'C:\\program files\\internet explorer\\iexplore.exe' , SalStrRepeatX ( 'x',208) )
 !  --> Does not work.
SalLoadAppAndProcessMsgs() seems not to care about the total command length, so the local solution might be to just change to this function.

Also, is there a way to just "run" command lines without CTD trying to find the application ? When I just enter 'iexplore.exe', SalLoadApp() tries to find the exe from path (unsuccessfully, since the file per se does not exist in path).

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3231
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: SalLoadApp max length ?

Post by Dave Rabelink » 01 Oct 2008, 06:39

have a look at this info
http://support.microsoft.com/kb/830473/en-us
http://msdn.microsoft.com/en-us/library/ms682425.aspx

Seems to be a SalLoadApp issue.

You could use
http://msdn.microsoft.com/en-us/library ... S.85).aspx

When you know that a file extension is linked to an executable (eg .htm -> iexplore, .doc -> Word) you can use FindExecutable to get the executable filename linked to the extension and use that result to start the application.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Ren

Re: SalLoadApp max length ?

Post by Ren » 01 Oct 2008, 06:56

Dave Rabelink wrote:have a look at this info
http://support.microsoft.com/kb/830473/en-us
http://msdn.microsoft.com/en-us/library/ms682425.aspx

Seems to be a SalLoadApp issue.
Yes, both of those links indicate that 8191 or 2047 characters is the max for any command line. SalLoadApp() has its own relative path EXE finder, which it then parses to a command line -- max 256 chars. I'm just looking for some confirmation that this is indeed so and not related to my terminal settings or version differences. If SalLoadApp() and SalLoadAppAndProcessMsgs() act differently in different versions of Team Developer, that's going to be a problem.

Also, SalLoadAppAndProcessMsgs() accepts characters up to 2127 or so, which is passing strange...

//Edit1: Also, CreateProcess() seems to accept max 32,768 characters, but I really don't want to go down that road ;)
Dave Rabelink wrote:You could use
http://msdn.microsoft.com/en-us/library ... S.85).aspx

When you know that a file extension is linked to an executable (eg .htm -> iexplore, .doc -> Word) you can use FindExecutable to get the executable filename linked to the extension and use that result to start the application.
Well, that's basically counter to what I want, I just want to match shortcuts and soft/hard links as well -- which the Windows 'run' command and cmd.exe do seamlessly -- or alternatively announce to the user "Whoops, couldn't find your executable in path, please set <INI VALUE X>."

Jeff Luther

Re: SalLoadApp max length ?

Post by Jeff Luther » 01 Oct 2008, 10:01

Well, I'm using an internal v5.2 SP4 and just tried your issue. I got up to a 447 parameter line which SalLoadApp() tried to run just fine. I don't see you mention what version of TD you are running, but the attached jpg shows the results of 447 total. I'll attach my v5.1 test case.
You do not have the required permissions to view the files attached to this post.

Ren

Re: SalLoadApp max length ?

Post by Ren » 01 Oct 2008, 10:36

Jeff Luther wrote:Well, I'm using an internal v5.2 SP4 and just tried your issue. I got up to a 447 parameter line which SalLoadApp() tried to run just fine. I don't see you mention what version of TD you are running, but the attached jpg shows the results of 447 total. I'll attach my v5.1 test case.
4.2, sorry. Verra interesting. I'll look into this some more.

Jeff Luther

Re: SalLoadApp max length ?

Post by Jeff Luther » 01 Oct 2008, 16:27

"I'll look into this some more" - I did too. I back-converted my test to v4.2 and sure enough, 254 is the longest SalLoadApp() allows with that version of TD. I'll enclose my 4.2 version.
You do not have the required permissions to view the files attached to this post.

Ren

Re: SalLoadApp max length ?

Post by Ren » 02 Oct 2008, 04:26

Jeff Luther wrote:"I'll look into this some more" - I did too. I back-converted my test to v4.2 and sure enough, 254 is the longest SalLoadApp() allows with that version of TD. I'll enclose my 4.2 version.
All right, so is there a non-blocking way to call these kinds of command lines in 4.2 ?

Jeff Luther

Re: SalLoadApp max length ?

Post by Jeff Luther » 02 Oct 2008, 08:26

One way might be to look at calling ShellExecute() directly: http://msdn.microsoft.com/en-us/library/bb762153.aspx

This page might help you too: http://support.microsoft.com/kb/170918

I've attached a sample I got off Lubos' site some time ago. That should get you started.
You do not have the required permissions to view the files attached to this post.

Return to “Bug Reports (TD 4.2 and older)”

Who is online

Users browsing this forum: No registered users and 0 guests