Lưu ý: xlfCaller đôi khi có thể trở lại một xloper đã cấp phát bộ nhớ bằng Excel. Khi xloper được thực hiện với, bộ nhớ phải được giải phóng bởi Excel. (Xem phần , Bắt Excel vào bộ nhớ miễn phí giao Excel để biết thêm chi tiết) Cảnh báo: | 238 Excel Add-in Development in C C Note xlfCaller can sometimes return an xloper that has had memory allocated by Excel. When the xloper is done with the memory must be freed by Excel. See section Getting Excel to free memory allocated by Excel for details. Warning The DLL can be called by the operating system for example DllMain or during a Windows call-back. Calling xlfCaller in these contexts is not necessary and may have strange and undesirable consequences. Note that some of Excel s built-in functions behave differently when called from a single cell or a number of cells in an array formula. This kind of behaviour can be replicated in DLL functions by detecting the type of the caller and the size if it is a range. See section Conversion of multi-cell range references on page 14 for more detail. You can also use the xlfGetCell function with argument 49 to detect if a given cell reference is part of an array. Apart from the usefulness of this function in determining the type of caller it plays an important role in the naming and tracking of cells that are performing some important task. See section immediately below and sections to . It also can play an important role in returning the pre-call value of the calling cell. This can be useful in stopping the propagation of errors as the following simple function demonstrates xloper stdcall CurrentValue xloper rtn_input xloper rtn_value cpp_xloper RetVal if rtn_input- xltype xltypeBool rtn_input- 1 return rtn_value cpp_xloper Caller Excel4 xlfCaller Caller 0 if xltypeSRef xltypeRef return NULL Excel4 xlCoerce RetVal 1 Caller if xltypeErr RetVal return false The function takes two optional arguments. The default behaviour of the function is to return the existing value of the cell. For this to work the function must be registered as a macro sheet equivalent function. The optional .