Update C# sample

Plug-in and third party software discussion.
Post Reply
jams
Posts: 16
Joined: Thu Mar 27, 2014 8:36 am
Contact:

Update C# sample

Post by jams » Wed Aug 30, 2017 8:52 pm

Hi,

I'm slowly building a C# library that wraps Everything into a fluent .NET API (https://github.com/ju2pom/EverythingNet).
I'd like to add support for file results attributes like size, filename, dates ...
But it's sometimes hard to find the correct way to declare the function prototype.

It would be very useful if you could extend the C# sample to wrap all available functions.

For example I could find the a working syntax for file size:

Code: Select all

[DllImport(EverythingDLL)]
public static extern IntPtr Everything_GetResultSize(int nIndex, IntPtr size);
But I could not find the correct syntax for Everything_GetResultFileName

Thanks

void
Site Admin
Posts: 4199
Joined: Fri Oct 16, 2009 11:31 pm

Re: Update C# sample

Post by void » Thu Aug 31, 2017 8:06 am

Updated:
http://www.voidtools.com/support/everything/sdk/csharp/

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

Code: Select all

[DllImport("Everything32.dll")]
public static extern bool Everything_GetResultSize(UInt32 nIndex, out long lpFileSize);

Code: Select all

UInt32 i;

for (i = 0; i < Everything_GetNumResults(); i++)
{
	long size;

	// get the result's full path and file name.
	Everything_GetResultSize(i, out size);

	// add it to the list box				
	listBox1.Items.Insert((int)i, size.ToString());
}

jams
Posts: 16
Joined: Thu Mar 27, 2014 8:36 am
Contact:

Re: Update C# sample

Post by jams » Thu Aug 31, 2017 8:27 pm

Hi,

Thanks a lot for your answer and the really fast update !
Unless I missed something there are still a few missing functions that I spotted:

Everything_GetResultListRequestFlags (easy one)
Everything_GetResultFileName (easy but not working?)
Everything_GetResultPath (already wrapped but always return null)

For your information I use the following flags:

Code: Select all

EVERYTHING_REQUEST_SIZE
EVERYTHING_REQUEST_FILE_NAME
EVERYTHING_REQUEST_ATTRIBUTES
EVERYTHING_REQUEST_PATH
EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME
EVERYTHING_REQUEST_DATE_CREATED
EVERYTHING_REQUEST_DATE_MODIFIED
EVERYTHING_REQUEST_DATE_ACCESSED
EVERYTHING_REQUEST_DATE_RUN;

void
Site Admin
Posts: 4199
Joined: Fri Oct 16, 2009 11:31 pm

Re: Update C# sample

Post by void » Thu Aug 31, 2017 10:31 pm

Updated:
http://www.voidtools.com/support/everything/sdk/csharp/

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

Added Everything_GetResultFileName (was incorrectly labeled as Everything_GetResultFullFileName):

Code: Select all

[DllImport("Everything32.dll", CharSet = CharSet.Unicode)]
public static extern string Everything_GetResultFileName(UInt32 nIndex);
Added Everything_GetSort:

Code: Select all

[DllImport("Everything32.dll")]
public static extern UInt32 Everything_GetSort();
Added Everything_GetResultListRequestFlags:

Code: Select all

[DllImport("Everything32.dll")]
public static extern UInt32 Everything_GetResultListRequestFlags();
Please check your definition of Everything_GetResultPath, also please make sure you are requesting EVERYTHING_REQUEST_PATH

Code: Select all

[DllImport("Everything32.dll", CharSet = CharSet.Unicode)]
public static extern string Everything_GetResultPath(UInt32 nIndex);

Post Reply