J
Jéjé
Hi,
I create an application which create then execute a DTS package.
I want to fill a TreeView using the events generated by the DTS package
(onerror, onprogress....)
my code works fine except if I turn off the ExecuteInMainThread property
(ExecuteInMainThread = False)
In this case I can't fill my TreeView but I can send Console output texts.
I have try to use the delegation to invoke my functions which update the
treeview, but without success.
I'm using some code coming from this post:
http://groups.google.ca/groups?hl=e...roup%3Dmicrosoft.public.dotnet.languages.vb.*
and this one
http://groups.google.ca/groups?hl=e...tainer&meta=group%3Dmicrosoft.public.dotnet.*
I have 4 methods: SetValue, SetError, SetStart, SetFinish
each one add a new node in the treeview
For example:
Friend Sub SetStart(ByVal source As String)
Dim oNode As TreeNode
Dim oNode2 As TreeNode
oNode = FindNodeByName(source)
If oNode Is Nothing Then
oNode = New TreeNode(String.Format("{0}", source))
oNode.Tag = source
oRootNode.Nodes.Add(oNode)
If bFirstExpand Then
oRootNode.Expand()
bFirstExpand = False
Application.DoEvents()
End If
End If
oNode2 = New TreeNode(String.Format("Start at: {0}", Now.ToString))
oNode.Nodes.Add(oNode2)
oNode.Expand()
End Sub
I have created a delegate object:
Public Delegate Sub SetStartDelegate(ByVal source As String)
Friend SetStartDel As SetStartDelegate = New SetStartDelegate(AddressOf
Me.SetStart)
In my OnStart DTS event I call this:
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
Console.WriteLine(" OnStart in {0}", EventSource)
Dim args() As Object = {EventSource}
frm.BeginInvoke(frm.SetStartDel, args)
'frm.SetStart(EventSource)
Application.DoEvents()
End Sub
but nothing appear. my SetStart method is called, but the code is locked at
this line:
oRootNode.Nodes.Add(oNode)
any guide?
thanks.
Jerome.
I create an application which create then execute a DTS package.
I want to fill a TreeView using the events generated by the DTS package
(onerror, onprogress....)
my code works fine except if I turn off the ExecuteInMainThread property
(ExecuteInMainThread = False)
In this case I can't fill my TreeView but I can send Console output texts.
I have try to use the delegation to invoke my functions which update the
treeview, but without success.
I'm using some code coming from this post:
http://groups.google.ca/groups?hl=e...roup%3Dmicrosoft.public.dotnet.languages.vb.*
and this one
http://groups.google.ca/groups?hl=e...tainer&meta=group%3Dmicrosoft.public.dotnet.*
I have 4 methods: SetValue, SetError, SetStart, SetFinish
each one add a new node in the treeview
For example:
Friend Sub SetStart(ByVal source As String)
Dim oNode As TreeNode
Dim oNode2 As TreeNode
oNode = FindNodeByName(source)
If oNode Is Nothing Then
oNode = New TreeNode(String.Format("{0}", source))
oNode.Tag = source
oRootNode.Nodes.Add(oNode)
If bFirstExpand Then
oRootNode.Expand()
bFirstExpand = False
Application.DoEvents()
End If
End If
oNode2 = New TreeNode(String.Format("Start at: {0}", Now.ToString))
oNode.Nodes.Add(oNode2)
oNode.Expand()
End Sub
I have created a delegate object:
Public Delegate Sub SetStartDelegate(ByVal source As String)
Friend SetStartDel As SetStartDelegate = New SetStartDelegate(AddressOf
Me.SetStart)
In my OnStart DTS event I call this:
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
Console.WriteLine(" OnStart in {0}", EventSource)
Dim args() As Object = {EventSource}
frm.BeginInvoke(frm.SetStartDel, args)
'frm.SetStart(EventSource)
Application.DoEvents()
End Sub
but nothing appear. my SetStart method is called, but the code is locked at
this line:
oRootNode.Nodes.Add(oNode)
any guide?
thanks.
Jerome.