Correct value for MiniDoc.sln project

Correct value for MiniDoc.sln project

Postby Sphere369 » Thu May 21, 2009 4:00 pm

Hi all,



I'm trying to run the minidoc project (Duffy's ExcelDriverProject2), but however my input values I have error messages such as below.



Thanks in advance for your help,



Sphere369.



Give lower value of interval: 0

Give upper value of interval: 1

Give number of subdivisions: 100

A etc 0, 1, 100

display

Creating Excel output, please wait a moment...Index non valide.

Press ANY key co continue:
Sphere369
 
Posts: 17
Joined: Tue May 19, 2009 10:51 pm

Postby Cuchulainn » Sun May 24, 2009 8:12 pm

Have you looked here because MS had changed the Excel interface?



http://www.egor.ch/cuchulainn/



I removed the zip file of my source code. Copyright issues.



Creating Excel output, please wait a moment...Index non valide.





Which versions of Excel are you using? See imports file
Attachments
ExcelImports.cpp
(3.26 KiB) Downloaded 846 times
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby Sphere369 » Sun May 24, 2009 9:19 pm

Hi,



I use Microsft Excel 2002. Please find attached the files updating by taking account of your remaks at http://www.egor.ch/cuchulainn/excel.htm



Regards.
Attachments
excelstuff.rar
(6.24 KiB) Downloaded 896 times
Sphere369
 
Posts: 17
Joined: Tue May 19, 2009 10:51 pm

Postby Cuchulainn » Sun May 24, 2009 10:25 pm

I see you mght have a French version. Then change "Sheet1" in ExcelDriver.cpp to French name "Feuille".



Excel::_WorksheetPtr pSheet = pWorkbook->Worksheets->GetItem("Sheet1");




What errors do you get exactly? Compile , run time?



Excel 2002 is a bit old but it should work. MS changed 'Value' to 'Value2' as well but I cannot remember when (just before 2003??)



hth[/b]
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby Sphere369 » Mon May 25, 2009 8:15 pm

Thanks. Unfortunatly I still having the same message error (in despite of the modification as indicated ("sheet1" to "feuille1").
Sphere369
 
Posts: 17
Joined: Tue May 19, 2009 10:51 pm

Postby Cuchulainn » Tue May 26, 2009 9:16 am

can you give a screen dump of the precise error?



EDIT: Right, I have solved the problem and will post the source code soon. BTW the correct code is in my 2006 book but I modified the 2004 code just to keep it authentic.



soon..
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby Sphere369 » Tue May 26, 2009 4:40 pm

Cuchulainn wrote:can you give a screen dump of the precise error?



EDIT: Right, I have solved the problem and will post the source code soon. BTW the correct code is in my 2006 book but I modified the 2004 code just to keep it authentic.



soon..




Please, are you talking about your second book : "Introduction to C++ for Financial Engineers" ?



As I was in emergency, I've bought onlinr its ebook three days ago, however there is not the datas on the CD attached with it.



Regards,
Sphere369
 
Posts: 17
Joined: Tue May 19, 2009 10:51 pm

Postby Cuchulainn » Tue May 26, 2009 4:47 pm

yeah, the publisher and the distributor have deal that is outside my control. The 2006 book is indeed the one.



What to do:



1. use my modified Exceldriver.cpp (Value2 and long as index)

2. All arrays, vectors and matrices MUST use use long e.g. Vector<double, long> in presentation, conversion, registration, main



Include is code. It works.
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby Sphere369 » Tue May 26, 2009 6:19 pm

I will try it. However, I've just re-ordered the real book this afternoon (+ the Architecture one...). I should receive it from tomorrow.



I have a question, regarding the use of the keyword export for the templates, as it seems to not been explain in your first book. Nowadays it seems to be the using of .tpp file instead of .cpp for the definition the templates classes. Could you please explain how do you take account of this ?
Sphere369
 
Posts: 17
Joined: Tue May 19, 2009 10:51 pm

Postby Cuchulainn » Tue May 26, 2009 9:42 pm

I have a question, regarding the use of the keyword export for the templates, as it seems to not been explain in your first book. Nowadays it seems to be the using of .tpp file instead of .cpp for the definition the templates classes. Could you please explain how do you take account of this ?



I have never had need to use export. What is used for?



Tpp or cpp is a choice; I used tpp in the 90's but moved back because it can also be confusing.[/i]
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby Sphere369 » Tue May 26, 2009 10:49 pm

Normally to avoid link error when one use templates.



e.g:



Code: Select all

// exemple.h



#ifndef EXEMPLE_H

#define EXEMPLE_H



template <typename T>

class Exemple

{

public:

    Exemple();

};



#include "exemple.tpp" // <-- astuce ici !!!

#endif







Code: Select all

// exemple.tpp



template <typename T>

Exemple<T>::Exemple()

{

}







Or the "export" option :



Code: Select all

// exemple.h



#ifndef EXEMPLE_H

#define EXEMPLE_H



template <typename T>

class Exemple

{

public:

    Exemple();

};



#endif







Code: Select all
// exemple.tpp

#include <exemple.h>



export template <typename T>

Exemple<T>::Exemple()

{

}

Sphere369
 
Posts: 17
Joined: Tue May 19, 2009 10:51 pm


Return to Financial Instrument Pricing using C++ (Duffy)

Who is online

Users browsing this forum: No registered users and 1 guest

cron