Jeffrey,
Thanks for your reply. I have upload my code to
www.oursadlives.com\dts\ManagedDTS.cs and
www.oursadlives.com\dts\DeployToolDlg.cs. The important UI methods are
"PrepPackage()", "RunPackage()" and "PackageStarted(object sender,
PackageEventsSink.PackageEventArgs e)"
The PackageEventsSink.OnStart method raises a custom event OnPackageStart
which I have hooked into in the dialog class. It is in the handler for the
OnPackageStart event where I am having problems (everything works fine if I
don't try and do stuff with the listview as I output stuff to the console to
tell me what's going on) if I try and step through the code it never gets
into the loop it hangs on the foreach(...) statement. As for
expectingMouseUp, as far as I know this is just a property of
ListView.Items, all I have been able to verify is that if I expand Items in
watch, then I can scoll up and down fine unless I let
ListView.Items.expectingMouseUp appear in which case it causes Visual Studio
to hang until I kill the running app through taskmanager.
I have tried executing the DTS class in another thread and that doesn't
change anything. Also I have noticed that if I am looping through the
listview then I receive no more console messages after the OnStart call.
I have read the document that you posted a link to, perhaps I haven't
totally understood it yet but surely I can't do the work on the listview in
a separate thread becuase it was created on the UI thread?
I hope this better explains my situation.
Cheers
Simon
Does your "eventhandler for the StartPackage event" mean OnStart method of
DTS.PackageEvents?
What is your "expectingMouseUp"?
Normally, the WinForm UI hang is caused by the long-time IO operation in
the main thread, which blocks the refresh of the UI.
I think you should check in your code which manipulates the UI, do not do
synchronization operation with UI.
Also, you can invoke Invalidate method of the control to force it refresh.
I think a better design is manipulate the data operation in a seperate
worker thread, then use control.invoke or control.BeginInvoke.
The articles below talks about the design-pattern of mainpulate WinForm UI
in multiThread:
http://msdn.microsoft.com/msdnmag/is...g/default.aspx
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.