Creating external function with C DLL 
Author Message
 Creating external function with C DLL

I am trying to build a REXX interface into my C DLL.  I have built the
DLL, and the REXX interpreter has no problem registering the external
function.  I use:
"rc = RxFuncAdd( 'MyFunc', 'MyDLL', 'MyFunc')"

But for some reason, the REXX interpreter is not passing the arguments
correctly to my external function.

Here is the function definition:

ULONG   MyFunc(
   PSZ         Name,
   LONG        Argc,
   RXSTRING    Argv[],
   PSZ         QueueName,
   PRXSTRING   Retstr)
{
   int dummy = 1;
   return 0;

Quote:
}

I used VisualAge C++ v3 to build the DLL.  It compiled with:
icc.exe /DSTATIC_LINK /Ti /Ge /Fo"{OBJ}" /C {CFILE}

My .DEF file contains:
LIBRARY VPKey INITINSTANCE TERMINSTANCE
PROTMODE
DATA MULTIPLE NONSHARED READWRITE LOADONCALL
CODE LOADONCALL
EXPORTS          ; Names of exported functions and data
  MyFunc

I'm using the VA de{*filter*} to view the contents of the arguments after my
DLL function is called.

The Expression monitor reports the following:
Name  "Invalid String"
Argc  1440180
Argv[0].strptr  "Invalid String"
QueueName "SESSION"
Retstr->strlen 256
Retstr->strptr "0   {name of dll}"

So the last two args sort of working, but the first 3 parameters are not.
I can't find any more reference on this, so any replies would be great.
Feel free to e-mail me as well.

Andy



Tue, 10 Nov 1998 03:00:00 GMT  
 Creating external function with C DLL


05/24/96 06:50am -0500

Have you got a RexxFunctionHandler statement for each of your
functions?  That statement seems to allocate storage for the argument
list.

Ciao, Albert



Tue, 10 Nov 1998 03:00:00 GMT  
 Creating external function with C DLL

Quote:

> Have you got a RexxFunctionHandler statement for each of your
> functions?  That statement seems to allocate storage for the argument
> list.

RexxFunctionHandler (in REXXSAA.H) is simply a typedef.  Since my
function prototype was identical to it, I thought it would be ok.

However, I changed my header file, replacing my prototype with
RexxFunctionHandler... and it WORKED!  I can't explain it yet, but thanks
for cluing me in.

Andy



Tue, 10 Nov 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Creating external functions for REXX in C

2. Create an external function in C

3. Calling an non-DLL external function

4. Using external DLL functions in a method

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

6. ACCEPT LOOP / EXTERNAL DLL / FUNCTION CALL / GPF

7. external rexx function dll with cygwin gcc ?

8. Rexx external function DLLs

9. Calling External DLL Functions

10. OS/2, external functions in RxFtp.dll???

11. VA 3.0 External C function and Crystal Report CRPE32.DLL

12. External link errors when using external Catalyst SocketTools Library Edition 2.15 dll

 

 
Powered by phpBB® Forum Software