Excel Add-in Development in C/C++: Applications in Finance
暫譯: C/C++ Excel 外掛開發:金融應用

Steve Dalton

  • 出版商: Wiley
  • 出版日期: 2004-12-15
  • 售價: $4,610
  • 貴賓價: 9.5$4,380
  • 語言: 英文
  • 頁數: 422
  • 裝訂: Hardcover
  • ISBN: 0470024690
  • ISBN-13: 9780470024690
  • 相關分類: C++ 程式語言Excel
  • 已絕版

買這商品的人也買了...

相關主題

商品描述

Description:

Excel is the industry standard for financial modelling, providing a number of ways for users to extend the functionality of their own add-ins, including VB. C/C++. Excel Add-in Development in C/C++ - Applications for Finance is a how-to guide and reference book for the creation of high performance add-ins for Excel in C and C++ for users in the finance industry. Author Steve Dalton explains how to apply Excel add-ins to financial applications with many examples given throughout the book. It covers the relative strengths and weaknesses of developing add-ins for Excel in VB versus C/C++.

"This book is for anyone who wants to do any application development in Excel. Even for an old hand at Excel development such as myself, a brief skim through reveals valuable nuggets of information. Delving deeper into the text, richer veins are easily found. This book is destined to become an essential reference on Excel development."
Dr. Les Clewlow, Principal, Lacima Group Ltd.

"Programming Excel add-ins using the C API can be complex and difficult. Steve has done a masterful job of demystifying the process. After reading this book you'll be creating XLLs for all purposes with complete confidence. Highly recommended."
Rob Bovey, MCSE, MCSD, Excel MVP, President, Application Professionals

 

 

Table of Contents:

Preface.

Acknowledgements.

1 Introduction.

1.1 Typographical and code conventions used in this book.

1.2 What tools and resources are required to write add-ins.

1.3 To which versions of Excel does this book apply?

1.4 About add-ins.

1.5 Why is this book needed?

1.6 How this book is organized.

1.7 Scope and limitations.

2 Excel Functionality.

2.1 Overview of Excel data organization.

2.2 A1 versus R1C1 cell references.

2.3 Cell contents.

2.4 Worksheet data types and limits.

2.5 Excel input parser.

2.6 Data type conversion.

2.7 Excel terminology: Active and current.

2.8 Commands versus functions in Excel.

2.9 Types of worksheet function.

2.10 Complex functions and commands.

2.11 Excel recalculation logic.

2.12 The Add-in Manager.

2.13 Loading and unloading add-ins.

2.14 Paste Function dialog.

2.15 Good spreadsheet design and practice.

2.16 Some problems with very large spreadsheets.

2.17 Conclusion.

3 UsingVBA.

3.1 Opening the VB Editor.

3.2 Using VBA to create new commands.

3.3 Assigning VB command macros to control objects in a worksheet.

3.4 Using VBA to trap Excel events.

3.5 Using VBA to create new functions.

3.6 Using VBA as an interface to external DLL add-ins.

3.7 Excel ranges, VB arrays, SafeArrays, array Variants.

3.8 Commands versus functions in VBA.

3.9 Creating VB add-ins (XLA files).

3.10 VB versus C/C++: Some basic questions.

4 Creating a 32-bit Windows (Win32) DLL Using Visual C++ 6.0 or Visual Studio .NET.

4.1 Windows library basics.

4.2 DLL basics.

4.3 DLL memory and multiple DLL instances.

4.4 Multi-threading.

4.5 Compiled function names.

4.6 Function calling conventions: cdecl, stdcall, fastcall.

4.7 Exporting DLL function names.

4.8 What you need to start developing add-ins in C/C++.

4.9 Creating a DLL using Visual C++ 6.0.

4.10 Creating a DLL using Visual C++ .NET 2003.

4.11 Accessing DLL functions from VB.

4.12 Accessing DLL functions from Excel.

5 Turning DLLs into XLLs: The Add-in Manager Interface.

5.1 Adding the Excel library and header files to a DLL project.

5.2 What does the Add-in Manager do?

5.3 Creating an XLL: The xlAuto interface functions.

5.4 When and in what order does Excel call the XLL interface functions?

5.5 XLL functions called by the Add-in Manager and Excel.

6 Passing Data between Excel and the DLL.

6.1 Handling Excel’s internal data structures: C or C++?

6.2 How Excel exchanges worksheet data with DLL add-in functions.

6.3 Defining constant xlopers.

6.4 A C++ class wrapper for the xloper – cpp_xloper.

6.5 Converting between xlopers and C/C++ data types.

6.6 Converting between xloper types.

6.7 Converting between xlopers and Variants.

6.8 Detailed discussion of xloper types.

6.9 Initialising xlopers.

6.10 Missing arguments.

7 Memory Management.

7.1 Excel stack space limitations.

7.2 Static add-in memory and multiple Excel instances.

7.3 Getting Excel to free memory allocated by Excel.

7.4 Getting Excel to call back the DLL to free DLL-allocated memory.

7.5 Returning data by modifying arguments in place.

8 Accessing Excel Functionality Using the C API.

8.1 The Excel 4 macro language (XLM).

8.2 The Excel4() C API function.

8.3 The Excel4v() C API function.

8.4 What C API functions can the DLL call and when?

8.5 Registering and un-registering DLL (XLL) functions.

8.6 Registering and un-registering DLL (XLL) commands.

8.7 Functions defined for the C API only.

8.8 Working with binary names.

8.9 Workspace information commands and functions.

8.10 Working with Excel names.

8.11 Working with Excel menus.

8.12 Working with toolbars.

8.13 Working with custom dialog boxes.

8.14 Trapping events.

8.15 Miscellaneous commands and functions.

8.16 The XLCallVer() C API function.

9 Miscellaneous Topics.

9.1 Timing function execution in VB and C/C++.

9.2 Relative performance of VB, C/C++: Tests and results.

9.3 Relative performance of C API versus VBA calling from a worksheet cell.

9.4 Detecting when a worksheet function is called from the Paste Function dialog (Function Wizard).

9.5 Accessing Excel functionality using COM/OLE Automation using C++.

9.6 Maintaining large data structures within the DLL.

9.7 A C++ Excel name class example, xlName.

9.8 Keeping track of the calling cell of a DLL function.

9.9 Multi-tasking, multi-threading and asynchronous calls in DLLs.

9.10 A background task management class and strategy.

9.11 How to crash Excel.

10 Example Add-ins and Financial Applications.

10.1 String functions.

10.2 Statistical functions.

10.3 Matrix functions – eigenvalues and eigenvectors.

10.4 Interpolation functions: lines, curves and splines.

10.5 Lookup and search functions.

10.6 Financial markets date functions.

10.7 Building and reading discount curves.

10.8 Building trees and lattices.

10.9 Quasi-random number sequences.

10.10 Generating correlated random samples.

10.11 Monte Carlo simulation.

10.12 Calibration.

References.

Web Links and Other Resources.

Index.

商品描述(中文翻譯)

描述:
Excel 是金融建模的行業標準,提供多種方式讓用戶擴展其自訂外掛的功能,包括 VB、C/C++。《Excel Add-in Development in C/C++ - Applications for Finance》是一本針對金融行業用戶創建高效能 Excel 外掛的實用指南和參考書。作者 Steve Dalton 解釋了如何將 Excel 外掛應用於金融應用,並在書中提供了許多範例。書中涵蓋了使用 VB 與 C/C++ 開發 Excel 外掛的相對優缺點。

「這本書適合任何想在 Excel 中進行應用開發的人。即使對於像我這樣的 Excel 開發老手,快速瀏覽後也能發現有價值的信息。深入閱讀後,更豐富的內容隨之而來。這本書注定會成為 Excel 開發的必備參考資料。」——Dr. Les Clewlow, Lacima Group Ltd. 首席顧問

「使用 C API 編程 Excel 外掛可能會很複雜且困難。Steve 將這個過程解釋得非常清晰。閱讀完這本書後,您將能夠自信地創建各種用途的 XLL。強烈推薦。」——Rob Bovey, MCSE, MCSD, Excel MVP, Application Professionals 總裁

目錄:
前言
致謝
1 介紹
1.1 本書中使用的排版和代碼約定
1.2 編寫外掛所需的工具和資源
1.3 本書適用於哪些版本的 Excel?
1.4 關於外掛
1.5 為什麼需要這本書?
1.6 本書的組織結構
1.7 範圍和限制
2 Excel 功能
2.1 Excel 數據組織概述
2.2 A1 與 R1C1 單元格引用
2.3 單元格內容
2.4 工作表數據類型和限制
2.5 Excel 輸入解析器
2.6 數據類型轉換
2.7 Excel 術語:活動和當前
2.8 Excel 中的命令與函數
2.9 工作表函數的類型
2.10 複雜的函數和命令
2.11 Excel 重新計算邏輯
2.12 外掛管理器
2.13 載入和卸載外掛
2.14 粘貼函數對話框
2.15 良好的電子表格設計和實踐
2.16 大型電子表格的一些問題
2.17 結論
3 使用 VBA
3.1 打開 VB 編輯器
3.2 使用 VBA 創建新命令
3.3 將 VB 命令宏分配給工作表中的控制對象
3.4 使用 VBA 捕獲 Excel 事件
3.5 使用 VBA 創建新函數
3.6 使用 VBA 作為外部 DLL 外掛的介面
3.7 Excel 範圍、VB 陣列、安全陣列、陣列變體
3.8 VBA 中的命令與函數
3.9 創建 VB 外掛(XLA 文件)
3.10 VB 與 C/C++:一些基本問題
4 使用 Visual C++ 6.0 或 Visual Studio .NET 創建 32 位 Windows (Win32) DLL
4.1 Windows 庫基礎
4.2 DLL 基礎
4.3 DLL 記憶體和多個 DLL 實例
4.4 多執行緒
4.5 編譯的函數名稱
4.6 函數調用約定:cdecl、stdcall、fastcall
4.7 將 DLL 函數名稱導出
4.8 開始在 C/C++ 中開發外掛所需的內容
4.9 使用 Visual C++ 6.0 創建 DLL
4.10 使用 Visual C++ .NET 2003 創建 DLL
4.11 從 VB 訪問 DLL 函數
4.12 從 Excel 訪問 DLL 函數
5 將 DLL 轉換為 XLL:外掛管理器介面
5.1 將 Excel 庫和標頭文件添加到 DLL 項目
5.2 外掛管理器的作用是什麼?
5.3 創建 XLL:xlAuto 介面函數
5.4 Excel 何時以及以何種順序調用 XLL 介面函數?
5.5 外掛管理器和 Excel 調用的 XLL 函數
6 在 Excel 和 DLL 之間傳遞數據
6.1 處理 Excel 的內部數據結構:C 還是 C++?
6.2 Excel 如何與 DLL 外掛函數交換工作表數據
6.3 定義常量 xlopers
6.4 用於 xloper 的 C++ 類包裝器 - cpp_xloper
6.5 在 xlopers 和 C/C++ 數據類型之間轉換
6.6 在 xloper 類型之間轉換
6.7 在 xlopers 和變體之間轉換
6.8 xloper 類型的詳細討論
6.9 初始化 xlopers
6.10 缺少的參數
7 記憶體管理
7.1 Excel 堆疊空間限制
7.2 靜態外掛記憶體和多個 Excel 實例
7.3 讓 Excel 釋放 Excel 分配的記憶體
7.4 讓 Excel 回調 DLL 以釋放 DLL 分配的記憶體
7.5 通過修改參數就地返回數據
8 使用 C API 訪問 Excel 功能
8.1 Excel 4 宏語言 (XLM)
8.2 Excel4() C API 函數
8.3 Excel4v() C API 函數
8.4 DLL 可以調用哪些 C API 函數以及何時調用?
8.5 註冊和取消註冊 DLL (XLL) 函數
8.6 註冊和取消註冊 DLL (XLL) 命令
8.7 僅為 C API 定義的函數
8.8 使用二進制名稱
8.9 工作區信息命令和函數
8.10 使用 Excel 名稱
8.11 使用 Excel 菜單
8.12 使用工具列
8.13 使用自訂對話框
8.14 捕獲事件
8.15 其他命令和函數
8.16 XLCallVer() C API 函數
9 其他主題
9.1 在 VB 和 C/C++ 中計時函數執行
9.2 VB、C/C++ 的相對性能:測試和結果
9.3 C API 與從工作表單元格調用的 VBA 的相對性能
9.4 檢測何時從粘貼函數對話框(函數精靈)調用工作表函數
9.5 使用 C++ 通過 COM/OLE 自動化訪問 Excel 功能
9.6 在 DLL 中維護大型數據結構
9.7 C++ Excel 名稱類示例,xlName
9.8 跟踪 DLL 函數的調用單元格
9.9 DLL 中的多任務、多執行緒和異步調用
9.10 背景任務管理類和策略
9.11 如何使 Excel 崩潰
10 示例外掛和金融應用
10.1 字串函數
10.2 統計函數
10.3 矩陣函數 - 特徵值和特徵向量
10.4 插值函數:直線、曲線和樣條
10.5 查找和搜索函數
10.6 金融市場日期函數
10.7 建立和讀取折現曲線
10.8 建立樹和格子
10.9 準隨機數序列
10.10 生成相關隨機樣本
10.11 蒙地卡羅模擬