OS/2, eCS & ArcaOS - Technical > Programming

REXX: RxStartSession, what is wrong with this call?

(1/3) > >>

Dariusz Piatkowski:
In my NAS box periodic 'connectivity check' script I'm trying to do away with running a separate REXX cmd script to set the DEFAULT folder VIEW. I decided to just bring the calls in that one-off script directly into my main REXX script.

Here is what I have:

1) the stand-alone cmd script has a call to oo.exe to default the folder VIEW

--- Code: ---...
/* Setup the default VIEW for the NAS Samba shares - FOLDERS */
'@g:\util\misc\oo.exe /a v:\photo "DEFAULTVIEW=XVIEW;"'
'@g:\util\misc\oo.exe /a v:\video "DEFAULTVIEW=XVIEW;"'
'@g:\util\misc\oo.exe /a v:\music "DEFAULTVIEW=XVIEW;"'
'@g:\util\misc\oo.exe /a v:\public\documents "DEFAULTVIEW=XVIEW;"'
'@g:\util\misc\oo.exe /a v:\public\syslog "DEFAULTVIEW=XVIEW;"'
...

--- End code ---

2) the main connectivity check script is using this call

--- Code: ---...
/* OK, now run the WPS settings utility */
api_rc=0
api_rc=RxStartSession('g:\util\misc\oo.exe','/a v:\photo "DEFAULTVIEW=XVIEW;"','C','F',,'O','A')
...

--- End code ---

Now this thing flat out fails all the time. I haven't been able to figure out why, all I can tell is that the stared session VIO window pops up with the following in it:


--- Code: ---invalid or malformed path

--- End code ---

Now, I cannot for the life of me tell what oo.exe is complaining. However, I've tried to successfully convert this in mulitple ways, even did a quick convert of REXX to EXE (REXX2EXE utiility) and strangely enough whenever I do actually get the oo.exe to execute the very same error message is displayed.

So I'm thinking there is some kind of a session issue here...???

EDIT
====
I grabbed the oo.exe sources (which Rich Walsh included in his release) and found where oo is tossing that error. Will debug from there...

Pete:
Hi Dariusz

I am *Not* a rexx expert and do not seem to have any information on RxStartSession apart from reading somewhere that it is part of the RXU addons for rexx. Just wondering about apostrophes and comma and whether your line would work when rewritten as

   'g:\util\misc\oo.exe /a v:\photo "DEFAULTVIEW=XVIEW;"','C','F',,'O','A'


Regards

Pete

Dariusz Piatkowski:
Hi Pete,


--- Quote from: Pete on January 04, 2021, 02:06:45 am ---...I am *Not* a rexx expert and do not seem to have any information on RxStartSession apart from reading somewhere that it is part of the RXU addons for rexx. Just wondering about apostrophes and comma and whether your line would work when rewritten as

   'g:\util\misc\oo.exe /a v:\photo "DEFAULTVIEW=XVIEW;"','C','F',,'O','A'
...

--- End quote ---

I would love to try that, the only challenge with that approach is the syntax of the RxStartSession API, which is detailed in the RXU v1.a INF file as:


--- Code: ---Syntax:

  strc = RxStartSession(pgmname [,args [,related [,fgbg [,title [,type
                        [,ctrl] ] ] ] ] ])

where

  pgmname   = name of .EXE file to execute
                or
              32-bit pointer to populated STARTDATA structure used by DosStartSession
  args      = arg string to pass to program
  related   = Relation of started session to this session, can be:
              'I'ndependent or 'C'hild
  fgbg      = Foreground/Background option, can be:
              'F'oreground or 'B'ackground
  title     = Session title (defaults to program name)
  type      = Program type, can be:
              'D'efault, 'F'ullscreen, 'P'M, 'V'irtual-Dos,
              'W'indowed-Virtual-Dos, vi'O'-windowable
  ctrl      = Program control, can be:
              'V'isible, 'I'nvisible, ma'X'imized, mi'N'imized,
              no'A'utoclose
  strc      = if DosStartSession failed:
              - return code from DosStartSession followed by error info
              if DosStartSession got zero rc:
              - return code from DosStartSession Session-ID Process-ID

--- End code ---

As best as I can tell that requires me to separate the actual EXE file (1st argument) from the remaining options, such as the EXE command line options themselves, as well as the remaining session configuration options.

Either way, I tried just about all of these remaining API options, the crux seems to be about oo.exe not picking up the passed parameters correctly, or most likely, these parameters not being passed to oo.exe in the way I intend them to be.

Alright, appreciate the pointer. I will jump back into building a debug version of oo.exe, so far I was able to compile the source, which is a great sign!


Andreas Schnellbacher:
I would be unsure of the error location. The syntax looks correct to me, even when I don't get what you gain from using Rx/DosStartSession (instead of cmd's CALL) and oo.exe (instead of SysSetObjectData).

I would comment other parts out to see if the erroneous line is the cited one. Then check if v:\photo really exists and is accessible. oo's error message assumes that it's not. Another test (without producing more unwanted EAs) is to change the setup string to "OPEN=DEFAULT;".

Lars:

--- Quote from: Dariusz Piatkowski on January 04, 2021, 02:26:39 am ---
--- Code: ---Syntax:

  strc = RxStartSession(pgmname [,args [,related [,fgbg [,title [,type
                        [,ctrl] ] ] ] ] ])

where

  pgmname   = name of .EXE file to execute
                or
              32-bit pointer to populated STARTDATA structure used by DosStartSession
  args      = arg string to pass to program
  related   = Relation of started session to this session, can be:
              'I'ndependent or 'C'hild
  fgbg      = Foreground/Background option, can be:
              'F'oreground or 'B'ackground
  title     = Session title (defaults to program name)
  type      = Program type, can be:
              'D'efault, 'F'ullscreen, 'P'M, 'V'irtual-Dos,
              'W'indowed-Virtual-Dos, vi'O'-windowable
  ctrl      = Program control, can be:
              'V'isible, 'I'nvisible, ma'X'imized, mi'N'imized,
              no'A'utoclose
  strc      = if DosStartSession failed:
              - return code from DosStartSession followed by error info
              if DosStartSession got zero rc:
              - return code from DosStartSession Session-ID Process-ID

--- End code ---

As best as I can tell that requires me to separate the actual EXE file (1st argument) from the remaining options, such as the EXE command line options themselves, as well as the remaining session configuration options.

Either way, I tried just about all of these remaining API options, the crux seems to be about oo.exe not picking up the passed parameters correctly, or most likely, these parameters not being passed to oo.exe in the way I intend them to be.

Alright, appreciate the pointer. I will jump back into building a debug version of oo.exe, so far I was able to compile the source, which is a great sign!

--- End quote ---

If you insist on doing it that way, I'd try "double double" quotes in the arg string. Depending on exactly HOW DosStartSession is invoked internally (does it run CMD.EXE under the hoods ? etc.) this could make a difference.

Navigation

[0] Message Index

[#] Next page

Go to full version