Macros for interfacing with Excel.
More...
|
| #define | XLKIT_INIT_ADDIN_LABEL(LABEL) |
| | Macro to register the name of the add-in. This shows up as the category in Excel's Function Wizard for all registered functions. More...
|
| |
| #define | XLKIT_PARM(VALUE_TYPE, NAME, HELP) |
| | Macro to create xlParm<NAME> typedef as xlParm<VALUE_TYPE, HELP> proxy type for a variable of VALUE_TYPE. More...
|
| |
| #define | XLKIT_REGISTER(FUNC, HELP) |
| | Macro to register the given function with xlkit. More...
|
| |
| #define | XLKIT_REGISTER_AS(XLNAME, FUNC, HELP) |
| | Macro to register the given function with xlkit with a different name from the C++ function name. More...
|
| |
|
#define | XLKIT_API __stdcall |
| | All registered functions must have this calling convention.
|
| |
|
#define | XLKIT_PRAGMA_DLL_EXPORT __pragma(comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)) |
| | Macro to export the enclosed function for Excel to use.
|
| |
| #define | XLKIT_BEGIN_FUNCTION |
| | All Excel functions begin with this macro. More...
|
| |
| #define | XLKIT_END_FUNCTION(RESULT_T) |
| | All Excel functions end with this macro. More...
|
| |
Macros for interfacing with Excel.
| #define XLKIT_BEGIN_FUNCTION |
Value:XLKIT_PRAGMA_DLL_EXPORT \
try { \
All Excel functions begin with this macro.
- Examples:
- xlkitExample.cpp.
| #define XLKIT_END_FUNCTION |
( |
|
RESULT_T | ) |
|
Value:}
catch (xlkit::xlException& err) {
\
XLDBG(
"Exception caught: %s", err.what()); \
return xlkit::detail::ErrorResult<RESULT_T>::value(); \
}
catch (std::exception& err){
\
XLDBG(
"Exception caught: %s", err.what()); \
return xlkit::detail::ErrorResult<RESULT_T>::value(err.what()); \
}
catch (xlkit::xlError& err){
\
XLDBG(
"Exception caught: %s", err.str().c_str()); \
return xlkit::detail::ErrorResult<RESULT_T>::value(err); \
XLDBG(
"Unknown exception caught"); \
return xlkit::detail::ErrorResult<RESULT_T>::value(); \
} \
#define XLDBG(FORMAT,...)
Provides a printf style debug output. When run inside Visual Studio, it will print to the Output wind...
Definition: xldebug.hpp:85
All Excel functions end with this macro.
- Note
- Return 0 will be interpreted by Excel as #NULL!.
- Examples:
- xlkitExample.cpp.
| #define XLKIT_INIT_ADDIN_LABEL |
( |
|
LABEL | ) |
|
Value:struct XLInitAddinLabel { \
XLInitAddinLabel() { \
xlkit::Registry::instance().setAddinLabel(LABEL); \
} \
}; \
static XLInitAddinLabel theInitAddinLabel; \
Macro to register the name of the add-in. This shows up as the category in Excel's Function Wizard for all registered functions.
| #define XLKIT_PARM |
( |
|
VALUE_TYPE, |
|
|
|
NAME, |
|
|
|
HELP |
|
) |
| |
Value:struct HELP_FOR_##NAME { }; \
namespace xlkit { \
XLKIT_USE_VERSION_NAMESPACE \
namespace detail { \
template <> struct ParmHelp<HELP_FOR_##NAME> { \
static const char* name() { return #NAME; } \
static const char* help() { return HELP; } \
}; \
} } } \
#define XLKIT_VERSION_NAME
Version namespace for this library.
Definition: xlversion.hpp:33
xlkit::Parm< T, PARM_HELP > xlParm
An xlkit function parameter of type T, with optional help for convenience. See Parm.
Definition: xlkit.hpp:375
Macro to create xlParm<NAME> typedef as xlParm<VALUE_TYPE, HELP> proxy type for a variable of VALUE_TYPE.
- Examples:
- xlkitExample.cpp.
| #define XLKIT_REGISTER |
( |
|
FUNC, |
|
|
|
HELP |
|
) |
| |
Value:struct FUNC##Registrar { \
FUNC##Registrar() { \
xlkit::Registry::instance().addFunction(#FUNC,FUNC,HELP); \
} \
}; \
static FUNC##Registrar the##FUNC##Registrar; \
Macro to register the given function with xlkit.
- Examples:
- xlkitExample.cpp.
| #define XLKIT_REGISTER_AS |
( |
|
XLNAME, |
|
|
|
FUNC, |
|
|
|
HELP |
|
) |
| |
Value:struct FUNC##Registrar { \
FUNC##Registrar() { \
xlkit::Registry::instance().addFunction(XLNAME,#FUNC,FUNC,HELP); \
} \
}; \
static FUNC##Registrar the##FUNC##Registrar; \
Macro to register the given function with xlkit with a different name from the C++ function name.