Đang chuẩn bị liên kết để tải về tài liệu:
Financial Applications using Excel Add-in Development in C/C++ phần 9

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Các thành viên của cpp_xloper chức năng Excel () gọi Excel4v () / Excel12v (), và thiết lập một lá cờ để cho các lớp học để sử dụng xlFree miễn phí bộ nhớ. (xloper/xloper12s điểm xltypeRef loại để cấp phát bộ nhớ). Mã IsActiveRef (), | 446 Excel Add-in Development in C C xloper __stdcall ExampleActiveOnly xloper pTrigger static count 0 could be incremented by more than one thread cpp_xloper Op Op.Excel xlfCaller Set Op caller s reference if Op.IsActiveRef Op count re-use Op for the return value else return the last value Op.ConvertRefToValues fails if not registered as type return Op.ExtractXloper The cpp_xloper s member function Excel calls Excel4v Excel12v and sets a flag to tell the class to use xlFree to free the memory. xloper xloper12s of type xltypeRef point to allocated memory . The code for IsActiveRef listed below uses the C API-only function xlSheetId to obtain the ID of the active sheet. Note that this ID is not the same as the .Index property from the above VBA example which is simply the index in the workbook s collection of sheets. Is the xloper a reference on the active sheet bool cpp_xloper IsActiveRef void const DWORD id if gExcelVersion12plus if m_Op12.xltype xltypeSRef then convert to xltypeRef xloper12 as_ref 0 xltypeNil xloper12 type 0 xltypeInt type.val.w xltypeRef Excel12 xlCoerce as_ref 2 m_Op12 type if as_ref.xltype xltypeRef return false id as_ref.val.mref.idSheet Excel12 xlFree 0 1 as_ref else if m_Op12.xltype xltypeRef id m_Op12.val.mref.idSheet else return false xloper12 active_sheet_id if Excel12 xlSheetId active_sheet_id 0 active_sheet_id.xltype xltypeRef id active_sheet_id.val.mref.idSheet No need to call xlFree active_sheet_id s xlmref pointer is NULL return false else if m_Op.xltype xltypeSRef then convert to xltypeRef Miscellaneous Topics 447 xloper as_ref 0 xltypeNil xloper type 0 xltypeInt type.val.w xltypeRef Excel4 xlCoerce as_ref 2 m_Op type if as_ref.xltype xltypeRef return false id as_ref.val.mref.idSheet Excel4 xlFree 0 1 as_ref else if m_Op.xltype xltypeRef id m_Op.val.mref.idSheet else return false xloper active_sheet_id if Excel4 xlSheetId active_sheet_id 0 active_sheet_id.xltype xltypeRef id active_sheet_id.val.mref.idSheet No need to call xlFree .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.