Click here to Skip to main content
15,906,081 members
Home / Discussions / C#
   

C#

 
QuestionHow to convert a file with extension .msg to .txt [modified] Pin
alokjha_mahe28-May-06 22:21
alokjha_mahe28-May-06 22:21 
AnswerRe: How to convert a file with extension .msg to .txt [modified] Pin
stancrm28-May-06 22:30
stancrm28-May-06 22:30 
AnswerRe: How to convert a file with extension .msg to .txt [modified] Pin
leppie29-May-06 4:35
leppie29-May-06 4:35 
Questiona question about date calculation ? Pin
cmpeng3428-May-06 22:09
cmpeng3428-May-06 22:09 
AnswerRe: a question about date calculation ? Pin
rah_sin28-May-06 22:26
professionalrah_sin28-May-06 22:26 
AnswerRe: a question about date calculation ? Pin
stancrm28-May-06 22:28
stancrm28-May-06 22:28 
AnswerRe: a question about date calculation ? Pin
foysal mamun28-May-06 22:32
foysal mamun28-May-06 22:32 
QuestionListview DragDrop Visual Themes error... Pin
Leon van Wyk28-May-06 22:08
professionalLeon van Wyk28-May-06 22:08 
I am working on a FTP client that works great but when I use file drop from windows explorer the application crashes and ends. The error breaks at the Application.Run(new Mainform); and gives me the following error: "An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll
Additional information: External component has thrown an exception." If I put a try catch around that I get this error message Exception.Message = "External component has thrown an exception."

I am using Visual Themes and are sure that that is the problem.

<br />
[STAThread]<br />
static void Main() <br />
{<br />
   try<br />
   {<br />
     Application.EnableVisualStyles();<br />
     Application.DoEvents();<br />
     Application.Run(new MainForm());<br />
   }<br />
   catch(Exception Ex)<br />
   {<br />
     MessageBox.Show(Ex.Message,"Runtime Error.",MessageBoxButtons.OK,MessageBoxIcon.Error);<br />
   }<br />
}<br />


When I take the EnableVisualStyles(); out it works fine. Also when I do a file drop, my progressbar losses the Visual Theme.

How do I get around this and still use the Visual Themes?

Here is my Drop code:

<br />
private void listView1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)<br />
{<br />
  if( e.Data.GetDataPresent(DataFormats.FileDrop, false))<br />
  {<br />
    string[] files_str = (string[])e.Data.GetData(DataFormats.FileDrop);<br />
<br />
      foreach(string file_str in files_str)<br />
      {<br />
         FileInfo droppedFile = new FileInfo(file_str);<br />
<br />
          if(droppedFile.Exists)<br />
	  {<br />
	    UploadFile(droppedFile);<br />
	  }<br />
	  else if(droppedFile.Directory.Exists)<br />
	  {<br />
	    DirectoryInfo droppedDirectory = new DirectoryInfo(file_str);<br />
<br />
	    if(droppedDirectory.Exists)<br />
	    {<br />
		UploadDirectoryChanges(droppedFile.Directory);<br />
	    }<br />
	}<br />
	else<br />
	{<br />
	  MessageBox.Show(file_str +"\nis not recognized as a valid file drop.","Unsupported File drop!",MessageBoxButtons.OK, MessageBoxIcon.Information);<br />
	}<br />
      }<br />
   }<br />
}<br />


Leon v Wyk
QuestionSqlParameter Array ? Pin
Mairaaj Khan28-May-06 21:28
professionalMairaaj Khan28-May-06 21:28 
AnswerRe: SqlParameter Array ? Pin
albCode28-May-06 21:31
albCode28-May-06 21:31 
GeneralRe: SqlParameter Array ? Pin
Colin Angus Mackay28-May-06 21:44
Colin Angus Mackay28-May-06 21:44 
GeneralRe: SqlParameter Array ? Pin
albCode28-May-06 22:24
albCode28-May-06 22:24 
GeneralRe: SqlParameter Array ? Pin
Mairaaj Khan28-May-06 23:34
professionalMairaaj Khan28-May-06 23:34 
AnswerRe: SqlParameter Array ? Pin
Colin Angus Mackay28-May-06 21:59
Colin Angus Mackay28-May-06 21:59 
GeneralRe: SqlParameter Array ? Pin
Mairaaj Khan28-May-06 23:48
professionalMairaaj Khan28-May-06 23:48 
Questionhow to remove special char from word doc Pin
ayyp28-May-06 21:14
ayyp28-May-06 21:14 
QuestionConverting Java to C#? Pin
econner28-May-06 17:10
econner28-May-06 17:10 
AnswerRe: Converting Java to C#? Pin
stancrm28-May-06 20:57
stancrm28-May-06 20:57 
AnswerRe: Converting Java to C#? Pin
mayuri12318-Jun-08 2:09
mayuri12318-Jun-08 2:09 
QuestionC# and SNMP Pin
mikeyhardingboyo28-May-06 17:00
mikeyhardingboyo28-May-06 17:00 
Questionbeginner in C# needs help Pin
keroed_edmond28-May-06 15:55
keroed_edmond28-May-06 15:55 
AnswerRe: beginner in C# needs help [modified] Pin
Sean8928-May-06 16:10
Sean8928-May-06 16:10 
GeneralRe: beginner in C# needs help [modified] Pin
keroed_edmond28-May-06 16:34
keroed_edmond28-May-06 16:34 
GeneralRe: beginner in C# needs help [modified] Pin
stancrm28-May-06 21:07
stancrm28-May-06 21:07 
QuestionDropDownList selected Pin
cppdotnet28-May-06 14:14
cppdotnet28-May-06 14:14 

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.