Click here to Skip to main content
15,894,180 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get distinct items from an array? Pin
Leslie Sanford19-Jun-06 16:43
Leslie Sanford19-Jun-06 16:43 
GeneralRe: How to get distinct items from an array? Pin
mejobloggs19-Jun-06 17:09
mejobloggs19-Jun-06 17:09 
AnswerRe: How to get distinct items from an array? Pin
Judah Gabriel Himango19-Jun-06 18:22
sponsorJudah Gabriel Himango19-Jun-06 18:22 
QuestionProcess.Start() mailto exception - default mail client Pin
stretchtack19-Jun-06 13:11
stretchtack19-Jun-06 13:11 
AnswerRe: Process.Start() mailto exception - default mail client Pin
Alexander Wiseman19-Jun-06 13:54
Alexander Wiseman19-Jun-06 13:54 
GeneralRe: Process.Start() mailto exception - default mail client Pin
stretchtack19-Jun-06 19:20
stretchtack19-Jun-06 19:20 
GeneralSTAThread vs. MTAThread - Process.Start() Pin
stretchtack20-Jun-06 7:28
stretchtack20-Jun-06 7:28 
GeneralRe: STAThread vs. MTAThread - Process.Start() Pin
Alexander Wiseman20-Jun-06 8:46
Alexander Wiseman20-Jun-06 8:46 
Stretch,

Thanks for your reply. This is a very interesting issue, to say the least! I do not know enough about the Multi-Threaded Apartment state to say for sure what is going on, but I'm guessing, by the error message, that it has something to do with not being able to access part of the registry, or accessing the wrong part of the registry when in a multi-threaded aparatment model. I need to do a few more searches for information about this; I hope it is documented somewhere.

In the meantime, if you want a quick and dirty workaround, you can run cmd.exe and execute the command that way. Since the Command Line Interpreter won't understand the "mailto" keyword, you have to use the "start" command to have it execute properly. This is the code I tried in a test application with the MTAThread attribute set, and it worked fine:
string mailToAddress = "mailto:joe.mama@exception.net";
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "cmd.exe";
myProcess.StartInfo.Arguments =  "/C start " + mailToAddress;
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.RedirectStandardOutput = false;
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
myProcess.Start();
Like I said, it's a little bit ungainly, but it does work. If I think of anything else, I'll let you know.

Sincerely,
Alexander Wiseman
QuestionSession State Transfer Pin
Expert Coming19-Jun-06 11:39
Expert Coming19-Jun-06 11:39 
QuestionNeural networks in c# Pin
yasar khan19-Jun-06 10:46
yasar khan19-Jun-06 10:46 
AnswerRe: Neural networks in c# Pin
Colin Angus Mackay19-Jun-06 11:13
Colin Angus Mackay19-Jun-06 11:13 
AnswerRe: Neural networks in c# Pin
Ravi Bhavnani19-Jun-06 11:39
professionalRavi Bhavnani19-Jun-06 11:39 
AnswerRe: Neural networks in c# Pin
User 171649219-Jun-06 13:29
professionalUser 171649219-Jun-06 13:29 
Questionexecting .bat file. Pin
tom laz19-Jun-06 10:29
tom laz19-Jun-06 10:29 
AnswerRe: execting .bat file. Pin
Ed.Poore19-Jun-06 10:33
Ed.Poore19-Jun-06 10:33 
AnswerRe: execting .bat file. Pin
Joshua Lunsford19-Jun-06 10:33
Joshua Lunsford19-Jun-06 10:33 
AnswerRe: execting .bat file. Pin
Spike^Blue^Heaven19-Jun-06 20:13
Spike^Blue^Heaven19-Jun-06 20:13 
GeneralRe: execting .bat file. Pin
tom laz19-Jun-06 10:46
tom laz19-Jun-06 10:46 
GeneralRe: execting .bat file. Pin
tom laz19-Jun-06 10:49
tom laz19-Jun-06 10:49 
GeneralRe: execting .bat file. Pin
Joshua Lunsford19-Jun-06 11:28
Joshua Lunsford19-Jun-06 11:28 
QuestionWindows Service with threading issues Pin
Joshua Lunsford19-Jun-06 10:26
Joshua Lunsford19-Jun-06 10:26 
AnswerRe: Windows Service with threading issues Pin
Tom Delany19-Jun-06 11:47
Tom Delany19-Jun-06 11:47 
QuestionPageSize not working on PagedDataSource populated by an ArrayList Pin
Afut19-Jun-06 9:07
Afut19-Jun-06 9:07 
QuestionNeural networks in c# Pin
yasar khan19-Jun-06 8:35
yasar khan19-Jun-06 8:35 
AnswerRe: Neural networks in c# Pin
Josh Smith19-Jun-06 9:58
Josh Smith19-Jun-06 9:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.