GetResultFileName
GetResultFileName
Hi all
In c# how do I get the filename only using Everything_GetResultFileName (version 1.3) ? I do not see any example with.
for (i = 0; i < EverythingClass.Everything_GetNumResults(); i++)
{
EverythingClass.Everything_GetResultFullPathNameW(i, buf, bufsize);
//if (EverythingClass.Everything_IsFileResult(i))
//{
f = buf.ToString(); // --- > getting the full path
//}
}
Thank you
In c# how do I get the filename only using Everything_GetResultFileName (version 1.3) ? I do not see any example with.
for (i = 0; i < EverythingClass.Everything_GetNumResults(); i++)
{
EverythingClass.Everything_GetResultFullPathNameW(i, buf, bufsize);
//if (EverythingClass.Everything_IsFileResult(i))
//{
f = buf.ToString(); // --- > getting the full path
//}
}
Thank you
Re: GetResultFileName
Please have a look at the C# example, with the changes below:
http://www.voidtools.com/support/everything/sdk/csharp/
http://www.voidtools.com/support/everything/sdk/csharp/
Code: Select all
[DllImport("Everything32.dll")]
public static extern string Everything_GetResultFileNameW(int nIndex);
private void button1_Click(object sender, EventArgs e)
{
int i;
// set the search
Everything_SetSearchW("ABC 123");
// execute the query
Everything_QueryW(true);
// clear the old list of results
listBox1.Items.Clear();
// loop through the results, adding each result to the listbox.
for (i = 0; i < Everything_GetNumResults(); i++)
{
// add it to the list box
listBox1.Items.Insert(i, Everything_GetResultFileNameW(i));
}
}
Re: GetResultFileName
I have added this test code with a listbox but the code with this message
has exited with code -2147483645 (0x80000003)
[DllImport("Everything64.dll")]
public static extern string Everything_GetResultFileNameW(int nIndex);
for (i = 0; i < EverythingClass.Everything_GetNumResults(); i++)
{
// add it to the list box
listBox1.Items.Insert(i, EverythingClass.Everything_GetResultFileNameW(i));
}
has exited with code -2147483645 (0x80000003)
has exited with code -2147483645 (0x80000003)
[DllImport("Everything64.dll")]
public static extern string Everything_GetResultFileNameW(int nIndex);
for (i = 0; i < EverythingClass.Everything_GetNumResults(); i++)
{
// add it to the list box
listBox1.Items.Insert(i, EverythingClass.Everything_GetResultFileNameW(i));
}
has exited with code -2147483645 (0x80000003)
Re: GetResultFileName
Error 80000003 = Failed to initialize.
[DllImport("Everything32.dll")]
Are you compiling as x64 or should this be:[DllImport("Everything64.dll")]
[DllImport("Everything32.dll")]
Re: GetResultFileName
yes its an X64 environement
Re: GetResultFileName
Please try changing:
to:
See working example:
http://www.voidtools.com/Everything.SDK ... rp.x64.zip
Code: Select all
[DllImport("Everything64.dll")]
public static extern string Everything_GetResultFileNameW(int nIndex);
Code: Select all
[DllImport("Everything64.dll", CharSet = CharSet.Unicode)]
public static extern string Everything_GetResultFileNameW(int nIndex);
http://www.voidtools.com/Everything.SDK ... rp.x64.zip
Re: GetResultFileName
Does not work. I have already tried. EverythingClass.Everything_GetResultFullPathNameW this is working for full path
The code quit when I try the Everything_GetResultFileName as the previous example.
The basic ideea was to filter paths from different folders. I want to search for files on specific folder.
The attached link is not working by the way. Error 404: Page not found
Thank you for your time.
The code quit when I try the Everything_GetResultFileName as the previous example.
The basic ideea was to filter paths from different folders. I want to search for files on specific folder.
Code: Select all
for (i = 0; i <= EverythingClass.Everything_GetNumResults(); i++)
{
if (EverythingClass.Everything_IsFileResult(i))
{
EverythingClass.Everything_GetResultFullPathNameW(i, buf, bufsize);
f = buf.ToString();
if (Path.GetFileName(f.ToLower()).Contains(SearchTextBox.Text.ToLower()))
{
addToDocFilesArr(f);
}
}
}
Thank you for your time.
Re: GetResultFileName
Everything_GetResultFileName is slightly different to the Everything_GetResultFullPathNameW call.
Everything_GetResultFileName returns a string, while Everything_GetResultFullPathNameW builds a string.
http://www.voidtools.com/Everything.SDK ... rp.x64.zip
Everything_GetResultFileName returns a string, while Everything_GetResultFullPathNameW builds a string.
Sorry I had a typo in the filename, it should work nowThe attached link is not working by the way. Error 404: Page not found
http://www.voidtools.com/Everything.SDK ... rp.x64.zip
Re: GetResultFileName
Everything program is running all folders are indexed
Question Everything installed is version X32 could be this an issue? except this call GetResultFileName everything else is running from my code
(The code have to run in x64 because there are other stuff that are running only x64.)
Visual response on code ...
The thread 0x626cc has exited with code 259 (0x103).
'WindowsApplication1.vshost.exe' (CLR v4.0.30319: WindowsApplication1.vshost.exe): Loaded 'C:\Users\####\Documents\SharpDevelop Projects\99-Testing\Everything.SDK.Example.CSharp.x64\bin\x64\Debug\WindowsApplication1.exe'. Symbols loaded.
The program '[403084] WindowsApplication1.vshost.exe' has exited with code -2147483645 (0x80000003).
Question Everything installed is version X32 could be this an issue? except this call GetResultFileName everything else is running from my code
(The code have to run in x64 because there are other stuff that are running only x64.)
Visual response on code ...
The thread 0x626cc has exited with code 259 (0x103).
'WindowsApplication1.vshost.exe' (CLR v4.0.30319: WindowsApplication1.vshost.exe): Loaded 'C:\Users\####\Documents\SharpDevelop Projects\99-Testing\Everything.SDK.Example.CSharp.x64\bin\x64\Debug\WindowsApplication1.exe'. Symbols loaded.
The program '[403084] WindowsApplication1.vshost.exe' has exited with code -2147483645 (0x80000003).
Re: GetResultFileName
It doesn't matter which version of Everything you use. It can be the x86 or x64 version.Question Everything installed is version X32 could be this an issue?
Please try the following changes:
[DllImport("Everything64.dll", CharSet = CharSet.Unicode)]
public static extern string Everything_GetResultFileNameW(int nIndex);
to:
[DllImport("Everything64.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultFileNameW(int nIndex);
and
listBox1.Items.Insert(i, Everything_GetResultFileNameW(i));
to:
listBox1.Items.Insert(i, Marshal.PtrToStringUni(Everything_GetResultFileNameW(i)));
http://stackoverflow.com/questions/1294 ... g-p-invoke
Re: GetResultFileName
Thank you very much. I am not expert into c#, but the last code made it.