Rexx external function DLLs 
Author Message
 Rexx external function DLLs

I'm trying to build a DLL that will have C functions to be called from
REXX.  I've gotten to the point where the rexx script loads the DLL
properly, but the parameters I get are not correct.

The REXX script first does:
        call RxFuncAdd 'DGSSLine', 'DGSSUTIL', 'DGSSLine'
which seems to work, and then
        call DGSSLine 1, 2

When the code for DGSSLine is called, it gets garbage for parameters.
I've looked at them, and I get things like the address for the
function name (the first parameter) being 5, and the argcount being
some huge number, and so on.  The REXXUTIL source that is shipped with
the warp toolkit appears to have the same problem.

DGSSLine is a function in C, declared as a RexxFunctionHandler, and
exported in the DLL.

The pointer for the return value seems to be correct, however.  Does
anyone out there have any idea what the deal is with this?  Is there a
problem in the warp toolkit or something?

--
John Knutson                            Applied Research Labs

 E-Mail for PGP key                     Voice:512-835-3482  Fax:3259



Tue, 26 Aug 1997 03:17:54 GMT  
 Rexx external function DLLs

Quote:
>When the code for DGSSLine is called, it gets garbage for parameters.

  They messed up the REXXSAA.H file in the Warp toolkit.  Either get a copy of
the v2.x REXXSAA.H file or compile with system linkage options (optilink is
default!).

Robert Mahoney                    Have trouble spelling?
2Rud Software and                Check out SpellGuard
Consulting                      An as-you-type spell checker



Wed, 27 Aug 1997 13:57:36 GMT  
 Rexx external function DLLs

Quote:


>>When the code for DGSSLine is called, it gets garbage for parameters.

>  They messed up the REXXSAA.H file in the Warp toolkit.  Either get a copy of
>the v2.x REXXSAA.H file or compile with system linkage options (optilink is
>default!).

Actually, all you have to do is to apply the following patch to the
Warp Toolkit's REXXSAA.H:

*** rexxsaa.h~  Sun Jan 15 20:54:00 1995
--- rexxsaa.h   Sun Jan 15 20:52:50 1995
***************
*** 463,469 ****
  #ifdef __cplusplus
  typedef ULONG APIENTRY RexxFunctionHandler(PUCHAR,
  #else
! typedef ULONG RexxFunctionHandler(PUCHAR,
  #endif
                                    ULONG,
                                    PRXSTRING,
--- 463,469 ----
  #ifdef __cplusplus
  typedef ULONG APIENTRY RexxFunctionHandler(PUCHAR,
  #else
! typedef ULONG APIENTRY RexxFunctionHandler(PUCHAR,
  #endif
                                    ULONG,

As you see, programming in C++ only also solves the problem. :-)

Kai Uwe Rommel

--
/* Kai Uwe Rommel                                      Muenchen, Germany *


DOS ... is still a real mode only non-reentrant interrupt
handler, and always will be.                -Russell Williams



Sun, 31 Aug 1997 04:47:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. external rexx function dll with cygwin gcc ?

2. External Rexx DLL in C and VX-REXX

3. Passing REXX stems to external REXX functions -Reply

4. Passing REXX stems to external REXX functions

5. sharing external functions between cms rexx programs and xedit rexx programs

6. external rexx function calls (OS/2 REXX)

7. MVS-REXX: Howto write REXX external functions in C

8. rexx calls to external dlls on NT

9. VX-REXX and external DLL's

10. Calling an non-DLL external function

11. Using external DLL functions in a method

12. function calls to external dll in 'routine's

 

 
Powered by phpBB® Forum Software