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.
get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
-
- Posts: 11
- Joined: Sat Dec 17, 2022 9:02 am
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
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?
(with zero results itr would be hard to get any date modified )
Could you post (the relevant part of) your code?
-
- Posts: 11
- Joined: Sat Dec 17, 2022 9:02 am
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
Thank you for your reply.
1. Everything_Query got some results. Actually, I got 8 when I call Everything_GetNumResults.
2. My code snippet:
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);
}
}
Last edited by NotNull on Sun Feb 12, 2023 4:29 pm, edited 1 time in total.
Reason: Added code tags </>
Reason: Added code tags </>
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
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
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
-
- Posts: 11
- Joined: Sat Dec 17, 2022 9:02 am
Re: get EVERYTHING_ERROR_INVALIDCALL when calling Everything_GetResultDateModified
Wow!Now I call Everything_SetRequestFlags before calling Everything_Query , That works.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
Thank you for reply and for the greet tool.