Function _conRegisterF() Foundation
Registers C-API functions at runtime
XPPAPIRET XPPAPIENTRY _conRegisterF(XppRegisterFunction *funcs,
int numOfFuncs,
XppRegisterTable *tbl);
The function returns a value > 0 when the registration is successful.
The function _conRegisterF() registers symbolic names of C-API functions at runtime of an Xbase++ application. This is required when C-API functions are linked into a DLL which is loaded dynamically with DllLoad(). In this case, REQUEST declarations cannot be used in the PRG code for declaring symbols for the linker. If REQUEST is used to declare a symbolic name, the DLL must be linked statically.
// ---------------------------------------------
// Xbase++ PRG code for dynamic registration of
// C-API function symbols
//
#include "DLL.CH"
DllLoad( "F2BIN.DLL" )
DllCall( "F2BIN.DLL", DLL_CDECL, "my_register" )
// ----------------------------------------------
// C-API code for dynamic registration of symbols
//
/*
* Functions declared in static table
*/
XppRegisterFunction MyFuncs = { { "F2BIN", F2BIN } ,
{ "BIN2F", BIN2F } };
/*
* Static structure to store all information required
* for later unregistration with _conUnregisterF()
*/
XppRegisterTable MyFuncsInfo;
/* Function which encapsulates registration. It can be called
* from the DLL startup routine or via DllCall().
*/
int my_register() {
return _conRegisterF(&MyFuncs,
sizeof(MyFuncs) / sizeof(XppRegisterFunction),
&MyFuncsInfo);
}
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.