Compare two range strings and check to see if they resolved into same object
int okoc_compare_obj_ranges( LPCSTR lpcszRange1, LPCSTR lpcszRange2, BOOL bIgnoreRowRange = true )
0 if two ranges are from the same object, -1 if lpcszRange1 is not valid, -2 if lpcszRange2 not valid, otherwise one of the > 0 enum like COR_DIFF_SHEET
EX1
#include <okocutils.h> // not included in origin.h, so you must add this void okoc_compare_obj_ranges_ex1() { Worksheet wks; wks.Create("Origin"); DataRange dr1; dr1.Add(wks, 0, "X"); Worksheet wks2; wks2.Create("Origin"); DataRange dr2; dr2.Add(wks2, 0, "X"); string strDR1, strDR2; dr1.GetRangeString(strDR1); dr2.GetRangeString(strDR2); bool ignoreRrows = true; int nRet = okoc_compare_obj_ranges(strDR1, strDR2, ignoreRrows); out_int("", nRet); // output 2 (COR_DIFF_SHEET) }
okocUtils.h