I have obtained a copy of rexxutil.dll from REXXLA.org (it is packaged with ooREXX), but I am having trouble getting Regina to access it. If I execute the instruction:
cc = RxFuncAdd( 'SysLoadFuncs', 'rexxutil', 'SysLoadFuncs' )
IBM's Object REXX returns 1, and everything works fine; but Regina returns 0, and all subsequent references to rexxutil functions fail.
I have tried placing rexxutil in the same directory as my Rexx program, in the Windows directory, and in the Windows SYSTEM directory. I have even changed the second parameter to point to the directory rexxutil resides in (e.g. "i:\winnt\rexxutil", both with and without ".dll"). None of this seems to work.
What am I doing wrong? Is there a different rexxutil for Regina (if so, why?)?
> cc = RxFuncAdd( 'SysLoadFuncs', 'rexxutil', 'SysLoadFuncs' )
Are you then actually calling the SysLoadFuncs function to load all the functions? eg
I suspect that is the missing statement.
FWIW I store function libraries such as rexxutil.dll in my Regina program directory (which is on the system search PATH).
I use the Patrick McPhee rexxutil.dll (http://www.interlog.com/~ptjm/software.html "RegUtil" package) with Regina on Win32, but AFAIK the ooREXX version should work.
Thanks for the suggestions. The call to SysLoadFuncs immediately follows the test for a successful completion of RxFuncAdd (I didn't show it in the original post because I wasn't getting that far). I downloaded Patrick McPhee's rexxutil (regutil) dll, and got a small improvement: now RxFuncAdd completes OK, but calling SysLoadFuncs gives me:
"'SYSLOADFUNCS' is not recognized as an internal or external command, operable program or batch file."
Maybe post the actual statement you use? Spurious quotes? Incorrect syntax for CALL?
This is the block I use here FWIW,
CALL RxFuncAdd 'SysLoadFuncs', 'rexxutil', 'SysLoadFuncs'
(and my rexxutil.dll is actually rexxutil.dll (all lower)).
Do other function libraries (w32util.dll for example) produce similar errors?
call rxfuncadd 'sysloadfuncs','RexxUtil','sysloadfuncs'
say 'SysDriveInfo' SysDriveInfo('c:\')
I remember some curious things with upper/lowercase.
But above works.
I have the same problem with w32funcs: the RxFuncAdd completes OK (returns 1), but invoking w32Version() gives me the same error )'W32VERSION' is not recognized...).
What directory do you keep these .dlls in? Are there other files which must accompany them? Do they require entries in the Windows Registry?
Thanks for your continued assistance!
OK problem solved. Here's what I had to do:
(1) place the .dll in question into my Windows directory (as specified by the %SystemRoot% environment variable, which is SystemRoot=I:\WINNT in my particular case). Note that this directory is also in my PATH). I think its the PATH that counts, though.
The other important revelation is to realize that RxFuncAdd only places an entry in a table, it doesn't actually check to see if the .dll file specified exists, so the result from invoking it is unimportant, and shouldn't be used to decide whether or not to continue processing.. A better way to check is to use rxFuncQuery( 'SysLoadFuncs' ) -- a result of 0 indicates that the function is available for use (1 means it is not).
Thanks again for all your help!
The call to RxFuncAdd() fails if the .dll cannot be loaded. It does more than put an entry in a table. It actually obtains a handle to the .dll so that each entry point can be determined.
Under Regina, the RxFuncErrMsg() BIF can be called after the RxFuncAdd() to determine why the .dll was not loaded. eg:
Call rxfuncadd, 'sysloadfuncs', 'rexxutil', 'sysloadfuncs'
When using Patrick McPhee's regutil, always use lower case for all 3 args to RxFuncAdd().
In reply to a previous question in this thread, the ooRexx or Object Rexx rexxutil.dll CANNOT be used with Regina. The ooRexx rexxutil.dll is built with references to the rexx.dll and rexxapi.dll that comes with ooRexx, not the regina.dll that comes with Regina.
Patrick McPhee's regutil is to be used with Regina.
Here's what else I have learned:
(1) any directory in the PATH will do
(2) Under Windows, it is not necessary to use lowercase for the 3 parameters to RxFuncAdd (it may, however, be necessary in a Unix environment, and is therefore the preferred practice -- I will change my code accordingly).
Thanks again to everyone!
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.