B
Bhavya Shah
Hello,
I am facing a very strange problem in my application.
I have a form on which I select a path. I open the FolderBrowserDialog for
path selection. Once the path is selected I press a button "Search" for
searching documents on that path. This search process runs in a separate
thread so that I can search for multiple paths simultaneously. I face
problem here. After starting the search for one path (that is starting one
thread), when I click on the select folder button to open the
folderbrowserdialog for selecting another path, the application throws and
exception (System.NullReferenceException, Object reference not set to
instance of an object).
I do not get this error if I do not search in thread.
Could anyone tell me the reason for this...I have tried everything but could
not solve the error.
I am pasting my thread starting code here.
FileSvcCrawler is a class which searches the path for documents.
FileSvcCrawler.FileSvcCrawler objFileSvcCrawler = new
FileSvcCrawler.FileSvcCrawler(txtComputer.Text,int.Parse(nudRescanInt.Value.
ToString()), ChangeStatus);
ThreadStart objThreadStart = new ThreadStart(objFileSvcCrawler.Crawl);
Thread objThread = new Thread(objThreadStart);
objThread.Name = strComputerName ;
objThread.IsBackground = true;
objThread.Priority = ThreadPriority.Lowest;
objThread.Start();
Regards,
Bhavya Shah
I am facing a very strange problem in my application.
I have a form on which I select a path. I open the FolderBrowserDialog for
path selection. Once the path is selected I press a button "Search" for
searching documents on that path. This search process runs in a separate
thread so that I can search for multiple paths simultaneously. I face
problem here. After starting the search for one path (that is starting one
thread), when I click on the select folder button to open the
folderbrowserdialog for selecting another path, the application throws and
exception (System.NullReferenceException, Object reference not set to
instance of an object).
I do not get this error if I do not search in thread.
Could anyone tell me the reason for this...I have tried everything but could
not solve the error.
I am pasting my thread starting code here.
FileSvcCrawler is a class which searches the path for documents.
FileSvcCrawler.FileSvcCrawler objFileSvcCrawler = new
FileSvcCrawler.FileSvcCrawler(txtComputer.Text,int.Parse(nudRescanInt.Value.
ToString()), ChangeStatus);
ThreadStart objThreadStart = new ThreadStart(objFileSvcCrawler.Crawl);
Thread objThread = new Thread(objThreadStart);
objThread.Name = strComputerName ;
objThread.IsBackground = true;
objThread.Priority = ThreadPriority.Lowest;
objThread.Start();
Regards,
Bhavya Shah