startprocess
-
hello i will receive "win32Exception" when i want to start process in this code:
ProcessStartInfo geols = new ProcessStartInfo("calc.exe", "");
System.Diagnostics.Process.Start(geols);please help me....:confused:
-
hello i will receive "win32Exception" when i want to start process in this code:
ProcessStartInfo geols = new ProcessStartInfo("calc.exe", "");
System.Diagnostics.Process.Start(geols);please help me....:confused:
eftekharpour wrote:
i will receive "win32Exception" when i want to start process
What exception? Unless you provide full details we cannot begin to guess what the problem is.
-
eftekharpour wrote:
i will receive "win32Exception" when i want to start process
What exception? Unless you provide full details we cannot begin to guess what the problem is.
in C# programming in windows mobile 6.5 i have an adress.that is
string path = "@\\Windows\\Geols\\GeolsCE.exe";
when i want start GeolsCE.exe i write :
public void StartProject()
{
try
{
//todo start geols
if (!string.IsNullOrEmpty(path))
{
ProcessStartInfo geols = new ProcessStartInfo(path, "");
System.Diagnostics.Process.Start(geols);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}but in line
System.Diagnostics.Process.Start(geols);
this goes catch and receive "Win32Exception" what is problem??this is force :(
-
in C# programming in windows mobile 6.5 i have an adress.that is
string path = "@\\Windows\\Geols\\GeolsCE.exe";
when i want start GeolsCE.exe i write :
public void StartProject()
{
try
{
//todo start geols
if (!string.IsNullOrEmpty(path))
{
ProcessStartInfo geols = new ProcessStartInfo(path, "");
System.Diagnostics.Process.Start(geols);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}but in line
System.Diagnostics.Process.Start(geols);
this goes catch and receive "Win32Exception" what is problem??this is force :(
What is the full text of the exception message? Given that your path string does not look valid I suspect it will be complaining about file not found.
-
What is the full text of the exception message? Given that your path string does not look valid I suspect it will be complaining about file not found.
how to Know full text of the exception message?
-
how to Know full text of the exception message?
i write this
catch (Win32Exception ex)
{
MessageBox.Show(ex.ErrorCode.ToString());
MessageBox.Show(ex.Message);}
i recive a number -1259545 in messagebox for errorcode and win32Exception in messegebox for ex.message. Do u need any things?
-
i write this
catch (Win32Exception ex)
{
MessageBox.Show(ex.ErrorCode.ToString());
MessageBox.Show(ex.Message);}
i recive a number -1259545 in messagebox for errorcode and win32Exception in messegebox for ex.message. Do u need any things?
anybody??
-
anybody??
Did you fix the path string in your code?
-
Did you fix the path string in your code?
hello no i am not set path becouse we haven't ManagementObjectSearcherin windows mobile,this is force.pls help meeee..
-
in C# programming in windows mobile 6.5 i have an adress.that is
string path = "@\\Windows\\Geols\\GeolsCE.exe";
when i want start GeolsCE.exe i write :
public void StartProject()
{
try
{
//todo start geols
if (!string.IsNullOrEmpty(path))
{
ProcessStartInfo geols = new ProcessStartInfo(path, "");
System.Diagnostics.Process.Start(geols);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}but in line
System.Diagnostics.Process.Start(geols);
this goes catch and receive "Win32Exception" what is problem??this is force :(
1. don't just show
ex.Message
The message is just a minor part of all the information in an Exception; you should display all of it, using
ex.ToString()
eftekharpour wrote:
string path = "@\\Windows\\Geols\\GeolsCE.exe";
That doesn't look good. On regular Windows it would be somethink akin to either one of these:
string path1 = "C:\\Program Files\\Windows NT\\Accessories\\Wordpad.exe";
string path2 = @"C:\Program Files\Windows NT\Accessories\Wordpad.exe";so the @ goes outside the double quotes and avoids escaping (=doubling up) the backslashes. FWIW: I have no idea where things get stored on Windows Mobile, so you may have to adapt the path somewhat. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
1. don't just show
ex.Message
The message is just a minor part of all the information in an Exception; you should display all of it, using
ex.ToString()
eftekharpour wrote:
string path = "@\\Windows\\Geols\\GeolsCE.exe";
That doesn't look good. On regular Windows it would be somethink akin to either one of these:
string path1 = "C:\\Program Files\\Windows NT\\Accessories\\Wordpad.exe";
string path2 = @"C:\Program Files\Windows NT\Accessories\Wordpad.exe";so the @ goes outside the double quotes and avoids escaping (=doubling up) the backslashes. FWIW: I have no idea where things get stored on Windows Mobile, so you may have to adapt the path somewhat. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
thanks lucy.but my problem is kill process in windows mobile.i have method that kill process but sometime occurd win32Exception myMethod:
public void EndProject()
{
try
{
//todo kill geols project
Process process1 = Process.GetProcessById(GetProcessID());
process1.Kill();
process1.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}i found a link see it pls.http://stackoverflow.com/questions/9501771/how-to-avoid-a-win32-exception-when-accessing-process-mainmodule-filename-in-c[^]
-
thanks lucy.but my problem is kill process in windows mobile.i have method that kill process but sometime occurd win32Exception myMethod:
public void EndProject()
{
try
{
//todo kill geols project
Process process1 = Process.GetProcessById(GetProcessID());
process1.Kill();
process1.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}i found a link see it pls.http://stackoverflow.com/questions/9501771/how-to-avoid-a-win32-exception-when-accessing-process-mainmodule-filename-in-c[^]
eftekharpour wrote:
kill process
So all of a sudden what you want is killing, not starting a process? then why does the subject line say "startprocess"???
eftekharpour wrote:
GetProcessID()
That does not even compile, the method needs an argument. I suggest you come back with a clear and precise question and/or code snippet if you want effective help. FYI: for some processes you won't be able to get any information. Whatever Task Manager is doing for you, most of it requires special privileges a typical app won't have. :|
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
hello no i am not set path becouse we haven't ManagementObjectSearcherin windows mobile,this is force.pls help meeee..
eftekharpour wrote:
pls help meeee..
With what? You still have not answered any of the questions asked of you, nor have you given a clear explanation of what your problem is. If a specific API call is not available in Windows Mobile, then that is probably because it would serve no purpose.
-
eftekharpour wrote:
pls help meeee..
With what? You still have not answered any of the questions asked of you, nor have you given a clear explanation of what your problem is. If a specific API call is not available in Windows Mobile, then that is probably because it would serve no purpose.
my problem is kill a process in windows mobile.i have method that kill process but sometime occurd win32Exception,i have method for get processes and processID and start process but when i kill process it say win32Exception.do u want that send my sourcecode for u? myMethod:
public void EndProject()
{
try
{
//todo kill geols project
Process process1 = Process.GetProcessById(GetProcessID());
process1.Kill();
process1.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}i found a link see it pls http://stackoverflow.com/questions/9501771/how-to-avoid-a-win32-exception-when-accessing-process-mainmodule-filename-in-c[^][^]
-
my problem is kill a process in windows mobile.i have method that kill process but sometime occurd win32Exception,i have method for get processes and processID and start process but when i kill process it say win32Exception.do u want that send my sourcecode for u? myMethod:
public void EndProject()
{
try
{
//todo kill geols project
Process process1 = Process.GetProcessById(GetProcessID());
process1.Kill();
process1.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}i found a link see it pls http://stackoverflow.com/questions/9501771/how-to-avoid-a-win32-exception-when-accessing-process-mainmodule-filename-in-c[^][^]
eftekharpour wrote:
but sometime occurd win32Exception
And once again I have to ask: "what is the exception detail"? You seem to think that people can guess what is happening on your system without any information, but I'm afraid they cannot. Unless you provide full information about what you are trying to do and the full details of what happens, then it's unlikely that anyone will be able to offer a suggestion.
-
eftekharpour wrote:
but sometime occurd win32Exception
And once again I have to ask: "what is the exception detail"? You seem to think that people can guess what is happening on your system without any information, but I'm afraid they cannot. Unless you provide full information about what you are trying to do and the full details of what happens, then it's unlikely that anyone will be able to offer a suggestion.
System.ComponentModel.Win32Exception at System.Diagnotics.Process.Kill() at Process.frmMain.EndProject() at Process.frmMain.tmrstartstop_Tick(Object Sender,EvenArgs e) at System.Windows.FormsTimer._WnProc(WM wm,Int32wParam,Int32 lParam) at System.Windows.Forms.ApplicationThreadContextMessage(WM wm,Int32 wParam,Int32 lparam)
-
System.ComponentModel.Win32Exception at System.Diagnotics.Process.Kill() at Process.frmMain.EndProject() at Process.frmMain.tmrstartstop_Tick(Object Sender,EvenArgs e) at System.Windows.FormsTimer._WnProc(WM wm,Int32wParam,Int32 lParam) at System.Windows.Forms.ApplicationThreadContextMessage(WM wm,Int32 wParam,Int32 lparam)
Try the manual, as I suggested. There's a reason why it's passing a NativeErrorCode. As stated; "Win32 error codes are translated from their numeric representations into a system message when they are displayed. Use NativeErrorCode to access the numeric representation of the error code associated with this exception. For more information about the error codes, see "Win32 Error Codes" in the Platform SDK documentation"
Bastard Programmer from Hell :suss:
-
Try the manual, as I suggested. There's a reason why it's passing a NativeErrorCode. As stated; "Win32 error codes are translated from their numeric representations into a system message when they are displayed. Use NativeErrorCode to access the numeric representation of the error code associated with this exception. For more information about the error codes, see "Win32 Error Codes" in the Platform SDK documentation"
Bastard Programmer from Hell :suss:
i don't know please explain clear..:( :(
-
i don't know please explain clear..:( :(
eftekharpour wrote:
i don't know please explain clear..:( :(
Go to this[^] page. That's the manual. Next, find the link that says "Win32Exception". You can find it on that page, without scrolling. Click on that link, and you'll get a page that explains the exception, and what might cause it. It's a generic exception, and if the message doesn't tell you what went wrong, then you'd need to fetch the NativeErrorCode[^] to see what caused the exception.
Bastard Programmer from Hell :suss: