Click here to Skip to main content
15,923,168 members
Home / Discussions / C#
   

C#

 
GeneralRe: array type at runtime Pin
thepersonof30-May-06 20:44
thepersonof30-May-06 20:44 
GeneralRe: array type at runtime Pin
S. Senthil Kumar31-May-06 7:14
S. Senthil Kumar31-May-06 7:14 
GeneralRe: array type at runtime Pin
thepersonof31-May-06 9:00
thepersonof31-May-06 9:00 
QuestionOutlook Add-In Pin
Malik Nasir28-May-06 23:51
Malik Nasir28-May-06 23:51 
Questionopening a .doc or .pdf file in richtextbox in C# Pin
AnurRS28-May-06 22:48
AnurRS28-May-06 22:48 
QuestionForLoop & Foreach Pin
SysJey28-May-06 22:30
SysJey28-May-06 22:30 
AnswerRe: ForLoop & Foreach [modified] Pin
Colin Angus Mackay28-May-06 22:34
Colin Angus Mackay28-May-06 22:34 
GeneralRe: ForLoop & Foreach Pin
S. Senthil Kumar29-May-06 1:37
S. Senthil Kumar29-May-06 1:37 
GeneralRe: ForLoop & Foreach Pin
Colin Angus Mackay29-May-06 4:41
Colin Angus Mackay29-May-06 4:41 
QuestionCmd prompt Pin
Support12328-May-06 22:26
Support12328-May-06 22:26 
AnswerRe: Cmd prompt Pin
Colin Angus Mackay28-May-06 22:31
Colin Angus Mackay28-May-06 22:31 
GeneralRe: Cmd prompt Pin
Support12328-May-06 22:35
Support12328-May-06 22:35 
GeneralRe: Cmd prompt Pin
Colin Angus Mackay28-May-06 22:40
Colin Angus Mackay28-May-06 22:40 
GeneralRe: Cmd prompt Pin
Support12328-May-06 22:45
Support12328-May-06 22:45 
Questionproblem with dataview Pin
foysal mamun28-May-06 22:25
foysal mamun28-May-06 22:25 
AnswerRe: problem with dataview [modified] Pin
rah_sin28-May-06 23:20
professionalrah_sin28-May-06 23:20 
GeneralRe: problem with dataview [modified] Pin
foysal mamun28-May-06 23:43
foysal mamun28-May-06 23:43 
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

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.