Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'excel add-in development in c/c++ applications in finance phần 4', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Turning DLLs into XLLs The Add-in Manager Interface 101 Free memory allocated by new_xlstring free xStr.val.str return 1 Using the C xloper class cpp_xloper introduced in section 6.4 the above code can be rewritten as follows int __stdcall xlAutoRemove void cpp_xloper xStr Version 1.0 has been removed cpp_xloper xInt 2 Dialog box type. Excel4 xlcAlert NULL 2 xStr xInt return 1 5.5.5 xlAddlnManagerlnfo xloper _stdcall xlAddInManagerInfo xloper Excel calls this function the first time the Add-in Manager is invoked. It should return an xloper string with the full name of the add-in which is then displayed in the Add-in Manager dialog Tools Add-lns. . See example below. If this function is omitted the Add-in Manager dialog simply displays the DOS 8.3 filename of the add-in without the path or extension. The function should return 1 to indicate success. Here is a simple example which uses a DLL function new_xlstring to create a byte-counted string that is marked for freeing once Excel has copied the value out. xloper __stdcall xlAddInManagerInfo xloper p_arg if xll_initialised xlAutoOpen static xloper ret_oper ret_oper.xltype xltypeErr ret_oper.val.err xlerrValue if p_arg NULL return ret_oper if p_arg- xltype xltypeNum p_arg- val.num 1.0 p_arg- xltype xltypeInt p_arg- val.w 1 Return a dynamically allocated byte-counted string and tell Excel to call back into the DLL to free it once Excel has finished. ret_oper.xltype xltypeStr xlbitDLLFree ret_oper.val.str new_xlstring My Add-in return ret_oper 102 Excel Add-in Development in C C Using the C xloper class cpp_xloper introduced in section 6.4 the above code can be rewritten as follows xloper __stdcall xlAddInManagerInfo xloper p_arg . . . if xll_initialised xlAutoOpen cpp_xloper Arg p_arg cpp_xloper RetVal if Arg 1 RetVal AddinName else RetVal WORD xlerrValue return RetVal.ExtractXloper Invoking the Add-in Manager calls this function resulting in the following being displayed 5.5.6 xlAutoRegister xloper __stdcall .