I'm sort of confused over what you're doing. Are you writing some software in
C? Because RexxRegisterSubcomDll() would normally be called only by a C program
(ie, not a REXX script).
Most of the REXX interpreters for personal computers have some APIs that are
intended to be called by programs written in compiled languages such as C/C++
(or Fortran or even assembly language, etc). In other words, the interpreter
not only runs REXX scripts -- it also provides a way for software written in
_other_ languages to launch REXX scripts, add new functions (written in a
language such as C) that are callable by that REXX script, and in general
interact (ie, exchange data) with that REXX script.
RexxRegisterSubcomDll() is one such API. RexxRegisterFunctionDll() is another
such API. Interpreters such as Reginald, Regina, and Object REXX have these
C/fortran/assembly/etc callable functions.
The purpose of RexxRegisterFunctionDll is to allow a program written in C, for
example, to add new functions designed for a REXX script to call. These
functions would normally be written in C. And by using RexxRegisterFunctionDll,
the C program makes these callable by your REXX script without your script
needing to use the REXX built-in function RXFUNCADD. (Think of RXFUNCADD as the
REXX script's version of the C callable RexxRegisterFunctionDll).
For example, you know that RexxEd makes special functions available to your
script to call such as EditGetDoc(), EditGetText(), etc. RexxEd is written in
C. EditGetDoc, EditGetText, etc, are C functions inside of my exe. I called
Reginald's RexxRegisterFunctionDll to make them available to any script that
RexxEd runs. Your script doesn't need to call RXFUNCADD to define EditGetDoc,
EditGetText, etc, because my C program does that for you using
Contrast this with REXX Dialog. Because REXX Dialog does not call
RexxRegisterFunctionDll, your script needs to call RXFUNCADD to add the REXX
Dialog functions such as RXMSG, RXCREATE, etc. (Ok, actually you have to
RXFUNCADD only one REXX Dialog function, RXDLGLOADFUNCS, and call it once.
RXDLGLOADFUNCS actually does call RexxRegisterFunctionDll to register each and
every one of the _other_ REXX Dialog functions. Otherwise, you would need to
call RXFUNCADD for every one of them. And yes, Reginald's auto-load feature
eliminates the need to even RXFUNCADD and call RXDLGLOADFUNCS, because that's
what the auto-load feature essentially does).
What I think you're really asking about is "How does a REXX script register
functions in a DLL?". The answer to that is, if the DLL is written to support
REXX, such as REXX Dialog, MIDI Rexx, some DLLs that Patrick or Florian make,
etc, then you need to use RXFUNCADD to register each and every function you
intend to call. (But like REXX Dialog, typically these DLLs give you one
function to RXFUNCADD, and when you call this, it registers all of the other
functions on your behalf. In REXX Dialog, this is called RXDLGLOADFUNCS, but
other DLLs will have their own name for it. For example, MIDI Rexx has
MIDILOADFUNCS. One of Patrick's DLLs has a SYSLOADFUNCS).
But, if you want to register functions in a DLL that is not specifically
designed to support REXX, such as a Windows operating system DLL like
USER32.DLL, then you need to use some proprietary method (and hope the
interpreter supports that). For example, Reginald offers FUNCDEF,