Trying to work with Excel files using C++ (as a pretty "less-than-professional" programmer). It seems I brought all the libraries in correctly, etc; if I need to post those and included SDKs, I can. However, I'm running into the above error.
Here is where I am working with the Excel file directly:
void themSheets() {
cout << endl << endl;
try {
Excel::_ApplicationPtr pXL;
pXL->Workbooks->Open(L"C:/Users/Person/source/repos/Metrics_Alpha/Metrics_Alpha/poooopy.xlsx");
pXL->PutVisible(0, FALSE);
Excel::_WorksheetPtr pSheet = pXL->ActiveSheet;
pSheet->Name = L"Sheet1";
Excel::RangePtr pRange = pSheet->Cells;
pRange->Item[1][1] = 5.21;
double apples = pRange->Item[1][1];
cout << endl << apples;
pXL->Workbooks->Close();
}
catch (_com_error & error) {
cout << error.Description() << endl;
}
}
And here is where the exception happens:
_NODISCARD static _CONSTEXPR17 size_t length(_In_z_ const _Elem* const _First) noexcept /* strengthened */ {
// find length of null-terminated string
#if _HAS_CXX17
#ifdef __cpp_char8_t
if constexpr (is_same_v<_Elem, char8_t>) {
#if _HAS_U8_INTRINSICS
return __builtin_u8strlen(_First);
#else // ^^^ use u8 intrinsics / no u8 intrinsics vvv
return _Primary_char_traits::length(_First);
#endif // _HAS_U8_INTRINSICS
} else
#endif // __cpp_char8_t
{
return __builtin_strlen(_First);
}
#else // _HAS_CXX17
return _CSTD strlen(reinterpret_cast<const char*>(_First)); **<--Happens right here**
#endif // _HAS_CXX17
}
question from:
https://stackoverflow.com/questions/66057705/unhandled-exception-at-0x78f90870-ucrtbased-dll-in-metrics-alpha-exe-0xc00000 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…