Questions about XLL development

This forum is to discuss the book "C++ design patterns and derivatives pricing."

Questions about XLL development

Postby Kayneo » Sat Mar 11, 2017 4:45 pm

Hi, guys. I have already developed an xll addin, which works fine if I write correct arguments.
The excel can show the name of the functions which I developed
Image

1. However, If the click the [fx]button in excel after I type the funtion name( look bolew) the excel crash right now.
Image

2. the arguments name can't be displayed fully in the function manager even if I type completed in my code, usually only first 2 or 3 arguments be displayed.
For example, the function xFSD1S_FV has maybe 20 arguments, however only 2 are displayed.
Image

Can any one help me to overcome these problems?


==== attachment xlautoopen function =================
int WINAPI xlAutoOpen(void)
{

static XLOPER12 xDLL; /* name of this DLL */
int i; /* Loop index */
Excel12f(xlGetName, &xDLL, 0);

for (i = 0; i<rgFuncsRows; i++)
{
Excel12f(xlfRegister, 0, 7,
(LPXLOPER12)&xDLL,
(LPXLOPER12)TempStr12(rgFuncs[i][0]),
(LPXLOPER12)TempStr12(rgFuncs[i][1]),
(LPXLOPER12)TempStr12(rgFuncs[i][2]),
(LPXLOPER12)TempStr12(rgFuncs[i][3]),
(LPXLOPER12)TempInt12(macrotype),
(LPXLOPER12)TempStr12(category)
);
}
}

======= and rgFuncs array =====================================
static LPWSTR rgFuncs[rgFuncsRows][4] = {
{
L"xFVanilla_CLOSED", L"QBBBBBBBBBBJJJQJ$",L"xFVanilla_CLOSED",
L"Principal,PricingDate,ExpiryDate,RefS,Spot,K,discount,rf,rd,vol,callflag,extraGreeks,"
L"oneyear,xlHoliday,method"
},
{
L"xFBarrier_CLOSED", L"QBBBBBBBBBBJJJBBBQJ$",L"xFBarrier_CLOSED",
L"Principal,PricingDate,ExpiryDate,RefS,Spot,K,discount,rf,rd,vol,callflag,extraGreeks,"
L"oneyear,barrier,barriertype,rebate,xlHoliday,method"
},
{
L"xFSD1D_FV",L"QJJBBBBBJBQQQQQQQQJJQQQBBQJJ$",L"xFSD1D_FV",
L"PricingDay,Today,Principal,Spot,RefS,QuantoAdj,DnBarrier,DnBarrierTouchFlag,Rebate,"
L"xlDiscountexpiry,xlDiscount,xlrfexpiry,xlrf,xlrdexpiry,xlrd,xlvolexpiry,xlvol,GreeksFlag,"
L"OneYear,xlRedemptionDate,xlStrikePrice,xlCoupon,BarrierShift,ShiftWidth,xlHoliday,place,indaynum"
}
}
Kayneo
 
Posts: 2
Joined: Fri Mar 10, 2017 5:08 am

Re: Questions about XLL development

Postby Kayneo » Mon Mar 13, 2017 3:02 am

I have known the problem!
The arguments list should only contains less than 255 characters, if it is larger than 255+2, then it's wrong
Kayneo
 
Posts: 2
Joined: Fri Mar 10, 2017 5:08 am


Return to C++ design patterns and derivatives pricing

Who is online

Users browsing this forum: No registered users and 2 guests

cron