Everything_GetResultFileNameW crashing from outlook plugin

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
rahulkumartv
Posts: 1
Joined: Mon Jan 12, 2015 10:16 am

Everything_GetResultFileNameW crashing from outlook plugin

Post by rahulkumartv »

I have created a outlook 2010 plugin and enabled a search using everything. Its UI is almost same as sample projects available in everything SDK(Csharp folder).But outlook is crashing while making call of Everything_GetResultFileNameW in Everything32.dll. I think it is problem inside Everything32.dll becuse same syntax call Everything_GetSearchW() working same code.
Code Snippet in C#
[DllImport("Everything32.dll", CharSet = CharSet.Unicode)]
public static extern StringBuilder Everything_GetSearchW();
[DllImport("Everything32.dll", CharSet = CharSet.Unicode)]
public static extern StringBuilder Everything_GetResultFileNameW(int nIndex);


Serach code:
StringBuilder strPath = new StringBuilder(260);
StringBuilder strName = new StringBuilder(260);
Everything_SetSearchW(SearchQuery.Text);
Everything_QueryW(true);
SearchResultView.Items.Clear();
int nNumResults = Everything_GetNumResults();
strName = Everything_GetSearchW();//working fine
MessageBox.Show(strName.ToString());
for ( int nIndex= 0;nIndex < nNumResults ; nIndex++)
{
Everything_GetResultFullPathNameW(nIndex, strPath, BUFFSIZE);
//MessageBox.Show("1");
try
{
strName = Everything_GetResultFileNameW(nIndex);/// crashing
}
catch
{

}

string[] itemRow = { strName.ToString(), strPath.ToString() };

var listViewItem = new ListViewItem(itemRow);

SearchResultView.Items.Add(listViewItem);

}
}
Post Reply