hey,
When I run my application in C# with 2threaders (one for the GUI and one for met DAL) it works pefectly fine on my Windows XP professional. But when I run the same program on a windows 2000 (on a VMware) system I get an error when my thread starts (a memorie error and I can not try catch it because its a real windows error (windows asks me to debug the application). Is there something wrong with my programma or is it the VMware?
thx!!!
10 5206
Welcome to the site. Please post the relevant code. My money is on the code rather than VMWare. Are there any other differences in platform between the two system, e.g IIS & Framework versions?
hey,
thx for the reply:
the code is a lot but I'll try,
In my ProgressPanel (that is attached to a FORM I call progressAll() from another Panel just be switching to that panel. - public void processAll()
-
{
-
try
-
{
-
rootWindow.btnNext.Enabled = false;
-
thread = new Thread(new ThreadStart(ApplicationDirector.Instance.processAll));
-
thread.Start();
-
new Thread(new ThreadStart(blockNextButton)).Start();
-
rootWindow.btnNext.Enabled = false;
-
}
-
catch (Exception ex)
-
{
-
MessageBox.Show("An Error Occured the file processing.", "Error during processing!", MessageBoxButtons.OK, MessageBoxIcon.Error);
-
log.Error("An Error Occured the file processing.", ex);
-
}
-
}
I also start an other thread to see when the thread ends. When the thread ends it wil enable the "NEXT" button and to some other stuff - public void blockNextButton()
-
{
-
try
-
{
-
while (thread.IsAlive)
-
{
-
Thread.Sleep(2000);
-
if (thread.IsAlive)
-
thread.Suspend();
-
Thread.Sleep(5);
-
if (thread.IsAlive)
-
thread.Resume();
-
}
-
rootWindow.btnNext.Enabled = true;
-
rootWindow.btnNext.Focus();
-
pgbGatheringData.Visible = false;
-
-
ApplicationDirector.Instance.writeToGui("Removing temporary files... ");
-
log4net.LogManager.Shutdown();
-
//Directory.Delete(Constants.rootDir,true);
-
ApplicationDirector.Instance.writeToGui("Temporary files deleted... ");
-
-
reportPanel.fillReportScreen();
-
ApplicationDirector.Instance.writeToGui("Data collection finished! ");
-
}
-
catch (Exception ex)
-
{
-
MessageBox.Show("An error occured during removing files : \r\n\r\nSome files could not have been deleted in " + Constants.rootDir + "\r\n\r\nException : "+ ex, "Error Removing Files!",MessageBoxButtons.OK,MessageBoxIcon.Error);
-
}
-
}
Like you can see when I start my thread I call "ApplicationDirector.Instance.processAll" With is my Facade and the code of that methode is (I know its al long methode but I also checks if the right option in de GUI *selectedOptionList* is selected en when It's selected you can execute it): - internal void processAll()
-
{
-
try
-
{
-
bool proccess = false;
-
foreach (string executableName in executableNames)
-
{
-
if (selectedOptionList.Contains(executableName))
-
proccess = true;
-
}
-
if (proccess == true)
-
{
-
logProgress("Collecting interfaces...");
-
executables = WindowsSystemScan.Instance.Executables; logProgress("Interfaces Collected...");
-
-
foreach (Executable executable in executables)
-
{
-
if (selectedOptionList.Contains(executable.GetType().Name))
-
{
-
logProgress("Interface \"" + Path.GetFileNameWithoutExtension(executable.FileName) + "\" is being processed.");
-
Logger.Instance.FoundedInterfaces.Add(Path.GetFileNameWithoutExtension(executable.FileName));
-
-
if (executable.GetType().Name.Equals("NormalExecutable") && selectedOptionList.Contains("NormalExecutableDB"))
-
((NormalExecutable)executable).WriteDBinfo = true;
-
-
executable.callHandler(executable);
-
}
-
}
-
}
-
proccess = false;
-
foreach (string dbName in dbNames)
-
{
-
if (selectedOptionList.Contains(dbName))
-
proccess = true;
-
}
-
if (proccess == true)
-
{
-
logProgress("Processing database information...");
-
foreach (string selectedOption in selectedOptionList)
-
{
-
switch (selectedOption)
-
{
-
case "PL/SQLTriggers":
-
logProgress("Triggers are being processed.");
-
GeneralInfoDBManager.Instance.processTriggers();
-
break;
-
case "PL/SQLFunctions":
-
logProgress("Functions are being processed.");
-
GeneralInfoDBManager.Instance.processFunctionFiles();
-
break;
-
case "PL/SQLProcedures":
-
logProgress("Procedures are being processed.");
-
GeneralInfoDBManager.Instance.processProcedureFiles();
-
break;
-
case "PL/SQLPackages":
-
logProgress("Packages are being processed.");
-
GeneralInfoDBManager.Instance.processPackageFiles();
-
break;
-
case "GeneralInfo":
-
logProgress("Extra interface information is being processed.");
-
GeneralInfoDBManager.Instance.processVersionFile();
-
GeneralInfoDBManager.Instance.processAllDbFiles();
-
break;
-
}
-
}
-
}
-
logProgress("All data is collected...");
-
logProgress("Creating zip-file...");
-
Zip.Instance.zip(Constants.rootDir);
-
logProgress("Zip-file created...");
-
if (Logger.Instance.ZippingEnded == false && Logger.Instance.MailZipFile == true)
-
{
-
UploadZipFile();
-
}
-
else
-
{
-
if (Logger.Instance.ZippingEnded == true)
-
logProgress("Zip-file was not created!");
-
if (Logger.Instance.MailZipFile == false)
-
logProgress("Zip-file was not mailed.");
-
Logger.Instance.ZippingEnded = true;
-
}
-
}
-
catch (Exception ex)
-
{
-
logProgress("Error during processing files.");
-
log.Error("Error during processing files.", ex);
-
}
-
}
The ERROR occurs in the class executables = "WindowsSystemScan.Instance.Executables;" but somethings in the beginning of the class sometimes an the end. He gives a memorie exception in windows I thing which I cant try, catch.
The strangest thing is. When I call "WindowsSystemScan.Instance.Executables;" BEFORE I start my thread in my panel he doesn't give an error but gives the error in the next class :p
I thank you for your time :) . I can also email you the application (it's 42 classes but only 949kb)
I also have these warnings, can that be the reason? But something that works on XP should also work in 2000, not? - Warning 1 'System.Runtime.InteropServices.FILETIME' is obsolete: 'Use System.Runtime.InteropServices.ComTypes.FILETIME instead. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellLinkNative.cs 44 25 Data Collector II
-
Warning 2 'System.Runtime.InteropServices.FILETIME' is obsolete: 'Use System.Runtime.InteropServices.ComTypes.FILETIME instead. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellLinkNative.cs 45 25 Data Collector II
-
Warning 3 'System.Runtime.InteropServices.FILETIME' is obsolete: 'Use System.Runtime.InteropServices.ComTypes.FILETIME instead. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellLinkNative.cs 46 25 Data Collector II
-
Warning 4 'System.Runtime.InteropServices.FILETIME' is obsolete: 'Use System.Runtime.InteropServices.ComTypes.FILETIME instead. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellLinkNative.cs 62 25 Data Collector II
-
Warning 5 'System.Runtime.InteropServices.FILETIME' is obsolete: 'Use System.Runtime.InteropServices.ComTypes.FILETIME instead. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellLinkNative.cs 63 25 Data Collector II
-
Warning 6 'System.Runtime.InteropServices.FILETIME' is obsolete: 'Use System.Runtime.InteropServices.ComTypes.FILETIME instead. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellLinkNative.cs 64 25 Data Collector II
-
Warning 7 'log4net.Appender.FileAppender.FileAppender(log4net.Layout.ILayout, string)' is obsolete: 'Instead use the default constructor and set the Layout & File properties' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\ApplicationDirector.cs 35 41 Data Collector II
-
Warning 8 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\ApplicationDirector.cs 149 60 Data Collector II
-
Warning 9 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\ApplicationDirector.cs 150 59 Data Collector II
-
Warning 10 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\ApplicationDirector.cs 151 59 Data Collector II
-
Warning 11 'System.Web.Mail.MailMessage' is obsolete: 'The recommended alternative is System.Net.Mail.MailMessage. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\InternetCommunication.cs 228 17 Data Collector II
-
Warning 12 'System.Web.Mail.MailMessage' is obsolete: 'The recommended alternative is System.Net.Mail.MailMessage. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\InternetCommunication.cs 228 39 Data Collector II
-
Warning 13 'System.Web.Mail.MailFormat' is obsolete: 'The recommended alternative is System.Net.Mail.MailMessage.IsBodyHtml. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\InternetCommunication.cs 233 34 Data Collector II
-
Warning 14 'System.Web.Mail.SmtpMail' is obsolete: 'The recommended alternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\InternetCommunication.cs 237 17 Data Collector II
-
Warning 15 The variable 'ex' is declared but never used C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\WindowsSystemScan.cs 201 21 Data Collector II
-
Warning 16 'System.Threading.Thread.Suspend()' is obsolete: 'Thread.Suspend has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\gui\ProgressPanel.cs 134 25 Data Collector II
-
Warning 17 'System.Threading.Thread.Resume()' is obsolete: 'Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\gui\ProgressPanel.cs 137 25 Data Collector II
-
Warning 18 The private field 'InterfaceCollector.domain.DAL.DirectoryManager.qbridgePath' is never used C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\DirectoryManager.cs 15 24 Data Collector II
Removed some error's - Warning 1 'log4net.Appender.FileAppender.FileAppender(log4net.Layout.ILayout, string)' is obsolete: 'Instead use the default constructor and set the Layout & File properties' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\ApplicationDirector.cs 35 41 Data Collector II
-
Warning 2 'System.Threading.Thread.Suspend()' is obsolete: 'Thread.Suspend has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\gui\ProgressPanel.cs 134 25 Data Collector II
-
Warning 3 'System.Threading.Thread.Resume()' is obsolete: 'Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\gui\ProgressPanel.cs 137 25 Data Collector II
Oké, I have just One warning on that log4net but that oké... but he keeps craching on the same problem!!
This is the exception in my logFile - &<?xml version="1.0" ?><log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2"><event logger="InterfaceCollector.domain.DAL.ApplicationDirector" timestamp="2007-03-19T21:02:14.2479872+01:00" level="INFO" thread="4" domain="Data Collector II.exe" username="AGVMSTUDENT\Administrator"><message>Collecting interfaces...</message><properties><data name="log4net:HostName" value="agvmstudent" /></properties></event>
-
<event logger="InterfaceCollector.domain.DAL.WindowsSystemScan" timestamp="2007-03-19T21:02:15.8603056+01:00" level="ERROR" thread="4" domain="Data Collector II.exe" username="AGVMSTUDENT\Administrator"><message>Error processing .Ink File.</message><properties><data name="log4net:HostName" value="agvmstudent" /></properties><exception>System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
-
at InterfaceCollector.domain.DAL.IShellLinkA.GetPath(StringBuilder pszFile, Int32 cchMaxPath, WIN32_FIND_DATAA& pfd, SLGP_FLAGS fFlags)
-
at InterfaceCollector.domain.DAL.ShellShortcut.get_Path() in C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellShortcut.cs:line 80
-
at InterfaceCollector.domain.DAL.WindowsSystemScan.processInk(FileInfo nextFile) in C:\Documents and Settings\AWYDZ\My Documents\Visual Studio 2005\Projects\Data Collector II\Data Collector II\domain\DAL\MainFlow\WindowsSystemScan.cs:line 172</exception></event>
-
&<?xml version="1.0" ?><log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2"><event logger="InterfaceCollector.domain.DAL.ApplicationDirector" timestamp="2007-03-19T21:03:58.7482512+01:00" level="INFO" thread="8" domain="Data Collector II.vshost.exe" username="AGVMSTUDENT\Administrator"><message>Collecting interfaces...</message><properties><data name="log4net:HostName" value="agvmstudent" /></properties></event>
-
<event logger="InterfaceCollector.domain.DAL.WindowsSystemScan" timestamp="2007-03-19T21:03:59.5994752+01:00" level="ERROR" thread="8" domain="Data Collector II.vshost.exe" username="AGVMSTUDENT\Administrator"><message>Error processing .Ink File.</message><properties><data name="log4net:HostName" value="agvmstudent" /></properties><exception>System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
-
at InterfaceCollector.domain.DAL.IShellLinkA.GetPath(StringBuilder pszFile, Int32 cchMaxPath, WIN32_FIND_DATAA& pfd, SLGP_FLAGS fFlags)
-
at InterfaceCollector.domain.DAL.ShellShortcut.get_Path() in C:\Documents and Settings\Administrator\Desktop\Data Collector II\Data Collector II\domain\DAL\MainFlow\ShellShortcut.cs:line 80
-
at InterfaceCollector.domain.DAL.WindowsSystemScan.processInk(FileInfo nextFile) in C:\Documents and Settings\Administrator\Desktop\Data Collector II\Data Collector II\domain\DAL\MainFlow\WindowsSystemScan.cs:line 163</exception></event>
-
&
My Panel changed to - public void processAll()
-
{
-
try
-
{
-
ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(ApplicationDirector.Instance.processAll));
-
rootWindow.btnNext.Enabled = false;
-
}
-
catch (Exception ex)
-
{
-
MessageBox.Show("An Error Occured the file processing.", "Error during processing!", MessageBoxButtons.OK, MessageBoxIcon.Error);
-
log.Error("An Error Occured the file processing.", ex);
-
}
-
}
-
public void blockNextButton()
-
{
-
try
-
{
-
rootWindow.btnNext.Enabled = true;
-
rootWindow.btnNext.Focus();
-
pgbGatheringData.Visible = false;
-
-
ApplicationDirector.Instance.writeToGui("Removing temporary files... ");
-
log4net.LogManager.Shutdown();
-
//Directory.Delete(Constants.rootDir,true);
-
ApplicationDirector.Instance.writeToGui("Temporary files deleted... ");
-
-
reportPanel.fillReportScreen();
-
ApplicationDirector.Instance.writeToGui("Data collection finished! ");
-
}
-
catch (Exception ex)
-
{
-
MessageBox.Show("An error occured during removing files : \r\n\r\nSome files could not have been deleted in " + Constants.rootDir + "\r\n\r\nException : "+ ex, "Error Removing Files!",MessageBoxButtons.OK,MessageBoxIcon.Error);
-
}
-
}
And at the lastline in my ApplicationManager I have added
rootGUI.blockNextButton(); //UNBLOCKs it (name has to be changed)
I was hoping that there was a small amount of relevant code. I'm not going to be able to go through that much code for you, you will need to make do with debugging techniques (unless someone else can quickly spot the problem). Have you migrated this application to asp.net 2.0?
It's by the way not that mutch code. Just the treading code is relevant (that are 5 classes +- 100 lines and 50 used.
Problem solved.
Always see if the code of you shellInterface is thread save :) (the solution can be found in my other topic)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: mihai |
last post by:
What does the standard say about those two? Is any assurance that the
use of STL is thread safe?
Have a nice day,
Mihai.
|
by: Mark Yudkin |
last post by:
The documentation is unclear (at least to me) on the permissibility of
accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003,
with separate transactions scope, from separate...
|
by: Robert Zurer |
last post by:
Can anyone suggest the best book or part of a book on this subject. I'm
looking for an in-depth treatment with examples in C#
TIA
Robert Zurer
robert@zurer.com
|
by: sarge |
last post by:
I would like to know how to perform simple multithreading.
I had created a simple form to test out if I was multithreading
properly, but got buggy results. Sometime the whole thig would lock
up...
|
by: who be dat? |
last post by:
Consider the following code which enables multithreading in an ASP.Net
application I'm writing:
Code in global.asx Application_start subroutine, Threadnotify is declared
Globally as a new thread...
|
by: shonend |
last post by:
**** sorry about the length of the message. If you can't read the
whole thing and still willing to help, read the last 2 paragraphs where
the main problem is described. The introduction story is...
|
by: Sam |
last post by:
Hi,
I have a serious issue using multithreading. A sample application
showing my issue can be downloaded here:
http://graphicsxp.free.fr/WindowsApplication11.zip
The problem is that I need to...
|
by: martin-g |
last post by:
Hi.
Some time ago I wrote a specialized Excel files merging tool using
Access. Input .xls files can be extremely large, so calculation
required for merging may last for a long. I have realized a...
|
by: Pradnya Patil |
last post by:
hi ,
I am trying to draw ' html div-tag ' on the screen which will
resemble a rectangle through vb.net code.
I want it to be drawn faster...so I introduced multithreading
using Threadpool. I...
|
by: Ray |
last post by:
Hello,
Greetings! I'm looking for a solid C++ multithreading book. Can you
recommend one? I don't think I've seen a multithreading C++ book that
everybody thinks is good (like Effective C++ or...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |