tailieunhanh - Excel add in development in c and c phần 9

Excel cư xử khác nhau khi được gọi từ một tế bào duy nhất hoặc một số tế bào trong một công thức mảng. Loại hành vi này có thể được nhân rộng trong các chức năng DLL bằng cách phát hiện các loại hình của người gọi, và kích thước nếu nó là một loạt. | 324 Excel Add-in Development in C C into a cell IF A1 LONG_TASK B1 LONG_TASK B2 Excel s recalculation logic would attempt to recalculate both calls to the function . In this example the user should enter LONG_TASK IF A1 B1 B2 instead. In any case it is not too burdensome to restrict the user to only entering a single long task in a single cell say. Should you wish to do so such rules are easily implemented using xlfGetFormula described in section on page 221. This is one of the things that should be taken care of in the long task interface function. The fact that you might need to do this is one of the reasons for registering it as a macro sheet function. The example in this section makes no restriction on the way the interface function is used in a cell although this is a weakness the user is relied upon only to enter one such function per cell. Organising the task list The example in this section uses the following simple structure to represent a task. Note that a more sensible approach would be to use a Standard Template Library STL container class. The some would say old-fashioned linked list used here could easily be replaced with such a container. The intention is not to propose the best way of coding such things but simply to lay out a complete approach that can be modified to suit coding preferences and experience. enum TASK_PENDING 0 TASK_CURRENT 1 TASK_READY 2 TASK_UNCLAIMED 4 TASK_COMPLETE 8 typedef struct tag_task tag_task prev prev task in list NULL if this is top tag_task next next task in list NULL if this is last long start_clock set by TaskList class long end_clock set by TaskList class bool break_task if true processing of this task should end short status PENDING cUrRENT ReAdY UNCLAIMED COMPLETE char caller_name dll-internal Excel name of caller bool fn_ptr tag_task passed in function ptr xloper fn_ret_val used for intermediate and final value int num_args xloper arg_array 1 1st in array of args for this task task This .

TỪ KHÓA LIÊN QUAN