Serving the Quantitative Finance Community

 
User avatar
DavidJN
Topic Author
Posts: 242
Joined: July 14th, 2002, 3:00 am

Excel C API question

February 13th, 2019, 4:17 am

I've built my XLL add-ins using the Excel C API for ages but not lately, and I've forgotten a detail.

The code line below assigns an error message string that will be returned by a function if a certain argument fails a certain error check:

result.val.str = "\043Time_in_years must be non-negative!"

The 043 in the code fragment is the length of the string "Time_in_years must be non-negative!" in some measure like degrees or radians or something like that. Maybe octal?

What I remember is that it is some kind of mathematical transform of the number of characters (including blank spaces) in the string message, 35 in the code fragment.

Any Excel C API power programmers out there?
 
User avatar
Cuchulainn
Posts: 20252
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Excel C API question

February 13th, 2019, 8:16 pm

Not me, but does the book by Steve Dalton?
A long shot is the Excel_DNA guys who use C API as wrapper. Maybe some joy there.
 
User avatar
FaridMoussaoui
Posts: 327
Joined: June 20th, 2008, 10:05 am
Location: Genève, Genf, Ginevra, Geneva

Re: Excel C API question

February 13th, 2019, 11:22 pm

I use XLW to wrap my C++ functions in Excel.
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Excel C API question

February 14th, 2019, 12:07 am

I also use XLW. Wasn't it created by some people from the forum? Mark Joshi?
 
User avatar
FaridMoussaoui
Posts: 327
Joined: June 20th, 2008, 10:05 am
Location: Genève, Genf, Ginevra, Geneva

Re: Excel C API question

February 14th, 2019, 1:05 am

1998, 1999, 2001, 2002, 2003, 2004 Jérôme Lecomte
2002, 2003, 2004 Ferdinando Ametrano
 2002, 2003, 2004 José Fonseca
2006 Mark Joshi
2007 Tim Brunne
2007, 2008 Eric Ehlers
2008, 2009 Narinder S Claire
2011 John Adcock
 
User avatar
DavidJN
Topic Author
Posts: 242
Joined: July 14th, 2002, 3:00 am

Re: Excel C API question

February 15th, 2019, 4:20 am

Okay, I remembered it. Count the number of characters including blank spaces in the text string and convert the answer from decimal to octal.