Page 1 of 1
get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
Posted: Sun Feb 12, 2023 12:18 pm
by yemanqitipo
Hello everyone。
I want to get the modify time of a file which everything retrieves.
when I call the api Everything_GetResultDateModified, I got error code EVERYTHING_ERROR_INVALIDCALL .
I saw the doc , it says "Call Everything_Query before calling Everything_GetResultDateModified.".
But I did call Everything_Query before I call Everything_GetResultDateModified.
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
Posted: Sun Feb 12, 2023 3:24 pm
by NotNull
Did you check if you got any results back from your Everything_Query?
(with zero results itr would be hard to get any date modified
)
Could you post (the relevant part of) your code?
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
Posted: Sun Feb 12, 2023 4:24 pm
by yemanqitipo
Thank you for your reply.
1. Everything_Query got some results. Actually, I got 8 when I call Everything_GetNumResults.
2. My code snippet:
Code: Select all
void CustomSearch(std::wstring regexStr, bool regexFlag) {
DWORD i;
const int MAX_TIME_LEN = 60;
char strTime[MAX_TIME_LEN] = { 0x00 };
// execute the query
Everything_QueryW(true);
int numResults = Everything_GetNumResults();
for (i = 0; i < numResults; i++)
{
wchar_t buf[MAX_PATH_LEN] = { 0x00 };
Everything_GetResultFullPathNameW(i, buf, MAX_PATH_LEN);
FILETIME dateModified;
SYSTEMTIME st;
bool ret = Everything_GetResultDateModified(i, &dateModified);
DWORD dwLastError = Everything_GetLastError();
if (dwLastError == EVERYTHING_ERROR_INVALIDCALL)
{
continue;
}
FileTimeToSystemTime(&dateModified, &st);
sprintf(strTime, "%d/%d/%d %02d:%02d:%02d",
st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
}
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
Posted: Mon Feb 13, 2023 1:11 am
by void
Please make sure Everything is running in the background.
Please check your call to
Everything_QueryW succeeds.
Please call
Everything_SetRequestFlags before calling Everything_Query and set the following flags:
EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH
| EVERYTHING_REQUEST_DATE_MODIFIED
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
Posted: Mon Feb 13, 2023 3:19 am
by yemanqitipo
void wrote: ↑Mon Feb 13, 2023 1:11 am
Please make sure Everything is running in the background.
Please check your call to
Everything_QueryW succeeds.
Please call
Everything_SetRequestFlags before calling Everything_Query and set the following flags:
EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH
| EVERYTHING_REQUEST_DATE_MODIFIED
Wow!Now I call Everything_SetRequestFlags before calling Everything_Query , That works.
Thank you for reply and for the greet tool.