Why Everyting_SetSort function does not work in python and CSharp code?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
FavorMylikes
Posts: 3
Joined: Fri Sep 01, 2017 3:14 am

Why Everyting_SetSort function does not work in python and CSharp code?

Post by FavorMylikes »

Here is my code.

Code: Select all

from ctypes import *
from ctypes.wintypes import  *

superSearch=windll.LoadLibrary(r"Everything64.dll")
superSearch.Everything_SetSearchW(c_wchar_p("*.mp3"))
superSearch.Everything_SetSort(13)//sort by DATE_MODIFIED_ASCENDING
superSearch.Everything_QueryW(1)
strBuff=create_unicode_buffer(255)
num=superSearch.Everything_GetNumResults()
for i in range(num):
    superSearch.Everything_GetResultFullPathNameW(i,byref(strBuff),len(strBuff))
    print(strBuff.value)
I have try to invoke Everything_GetResultListSort() after Everything_QueryW(1). But it always 1. And I wanna see what's errcode by calling Everything_GetLastError(). But it always 0 looks nothing wrong here.

here some comment on Everything offical website
It is possible the sort is not supported,, in which case after you have received your results you should call *Everything_GetResultListSort to determine the sorting actually used.
Is there any advice? Thanks a lot.
void
Developer
Posts: 16848
Joined: Fri Oct 16, 2009 11:31 pm

Re: Why Everyting_SetSort function does not work in python and CSharp code?

Post by void »

Do you have fast date modified sorting enabled in Everything from Tools -> Options -> Indexes ?
FavorMylikes
Posts: 3
Joined: Fri Sep 01, 2017 3:14 am

Re: Why Everyting_SetSort function does not work in python and CSharp code?

Post by FavorMylikes »

void wrote:Do you have fast date modified sorting enabled in Everything from Tools -> Options -> Indexes ?
yes,I have enabled
fast date modified sorting
fast size sorting
fast path sorting
but no one could be used
void
Developer
Posts: 16848
Joined: Fri Oct 16, 2009 11:31 pm

Re: Why Everyting_SetSort function does not work in python and CSharp code?

Post by void »

How do you import Everything_SetSort ?
Maybe it is trying to take a 64bit integer for the first parameter, when it should be only taking a 32bit integer.

I've updated the x64 C# example to sort by date modified:
http://www.voidtools.com/Everything-SDK.zip
FavorMylikes
Posts: 3
Joined: Fri Sep 01, 2017 3:14 am

Re: Why Everyting_SetSort function does not work in python and CSharp code?

Post by FavorMylikes »

void wrote:How do you import Everything_SetSort ?
Maybe it is trying to take a 64bit integer for the first parameter, when it should be only taking a 32bit integer.

I've updated the x64 C# example to sort by date modified:
http://www.voidtools.com/Everything-SDK.zip
Thank you for your reply.
I have figure it out.
But I don't know if it is my fault actural.
I read C source code, it looks like that I should calling SetRequestFlags function before Query as same as SetSort
It work now.
Thank you again.
void
Developer
Posts: 16848
Joined: Fri Oct 16, 2009 11:31 pm

Re: Why Everyting_SetSort function does not work in python and CSharp code?

Post by void »

it looks like that I should calling SetRequestFlags function before Query as same as SetSort
Thanks for pointing this out.

This is a bug with the SDK.

I've updated the SDK so you don't need to call SetRequestFlags for SetSort to work.

http://www.voidtools.com/Everything-SDK.zip
Post Reply