
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