Cảnh báo: Không có cách nào rằng một chức năng tiếp nhận một con trỏ đến một xl_array có thể kiểm tra cho rằng kích thước của bộ nhớ được phân bổ là đủ cho tất cả các yếu tố ngụ ý bởi hàng của mình và được chứa trong cấu trúc, cũng là hợp lệ. | Accessing Excel Functionality Using the C API 195 macro sheet version of this function CALL used to be available on worksheets. This enabled a spreadsheet with no XLM or VB macros to access any DLL s functionality without alerting the user to the potential misuse that this could be put to. This security chasm was closed in version . Un-registering a DLL function Excel keeps an internal list of the functions that have been registered from a given DLL as well as the number of times each function has been registered. You can interrogate Excel about the loaded DLL functions using the xlfGetWorkspace argument 44. See section Information about the workspace xlfGetWorkspace on page 227 for details. When registering a function the xlfRegister function does two things. 1. Increments the count for the registered function. 2. Associates the function s worksheet name given as the 4th argument to xlfRegister with the DLL resource. To un-register a function you therefore have to undo both of these actions in order to restore Excel to the pre-DLL state. The xlfUnregister function which takes the register ID returned by the call to xlfRegister decrements the usage count of the function. To disassociate the function s worksheet name you need to call the xlfSetName function which usually associates a name with a resource but without specifying a resource. This clears the existing associated resource - the DLL function. Sadly a bug in Excel prevents even this two-pronged approach from successfully removing the reference to the function. In practice not un-registering functions has no grave consequences. Warning The C API function xlfUnregister supports another syntax which takes a DLL name as returned by the function xlfGetName. Called in this way it un-registers all that DLL s resources. This syntax also causes Excel to call xlAutoClose . You will therefore crash Excel with a stack overflow if you call xlfUnregister with this syntax from within xlAutoClose . You .