This example shows a very basic add-in function.
// Function: MySquare // Returns: double // Description: Returns the square of the input //{{XLP_SRC(MySquare) // NOTE - the FunctionWizard will add and remove mapping code here. // DO NOT EDIT what you see in these blocks of generated code! IMPLEMENT_XLLFN3(MySquare, MySquare_4, MySquare_12, "BB", "BB", L"MySquare", 0, L"Input", 0, L"14", 0, L"Returns the square of the input", 0, L"Number who" L"se square is to be returned\0", 0, 0, L"{MySquare,,,Returns the square o" L"f the input,14,1,128,B,{{0,{Input,Double,0,,Number whose square is to be" L" returned,,,,}}},{},3,,0,0}", 1) double MySquare_Impl(double); extern "C" __declspec(dllexport) double MySquare_12(double Input) { XLL_FIX_STATE; return MySquare_Impl(Input); } extern "C" __declspec(dllexport) double MySquare_4(double Input) { XLL_FIX_STATE; return MySquare_Impl(Input); } double MySquare_Impl(double Input) { // End of generated code //}}XLP_SRC return Input * Input; }