473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with raising an event form class

Hi,
I followed the the aricle
http://support.microsoft.com/default...b;en-us;321525 and was able
to execute a dts package
in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
I am having is that on my form I added a listbox control
and I created a sub that added entries to the list box

Public Sub addListItems(ByVal sItem As String)

ListBox1.Items.Add(sItem)

End Sub

Then I replaced all the "msgbox" with addListItems(<message>). But form the
PackageEventsSink class how do I execute the addListItems
on form1 to add the entries to the listbox. What I tried was creating an
event in the PackageEventsSink class

Public Event Message(ByVal sMessage As String)

and I tried to raise it like

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error")

'MsgBox("Error")
End Sub

and form form1 I did the foll

declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink

and add
Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

ListBox1.Items.Add(sMessage)
Application.DoEvents()

End Sub

But when I run the program I get all the message boxes but then the program
hangs on the event. I get no error message. It just hangs.

This is the code


-------------class

Public Class PackageEventsSink
Implements DTS.PackageEvents

Public Event Message(ByVal sMessage As String)

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error") <--------------here I believe is error.

'MsgBox("Error")
End Sub
Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnFinish
MsgBox("On Finished")
End Sub
Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
ByVal ProgressDescription As String, ByVal PercentComplete As
Integer, _
ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
Integer) _
Implements DTS.PackageEvents.OnProgress

MsgBox("On Progress")
End Sub
Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
ByRef pbCancel As Boolean) Implements
DTS.PackageEvents.OnQueryCancel
If EventSource.Length > 0 Then
MsgBox("Query Cancel Yes")
Else
MsgBox("Query Cancel No")
End If
pbCancel = False
End Sub
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
MsgBox("On Start")
End Sub
End Class
--------------form 1

Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
Dim pkg As DTS.Package
Try
pkg = New DTS.Package
'Begin - set up events sink
Dim cpContainer As UCOMIConnectionPointContainer
cpContainer = CType(pkg, UCOMIConnectionPointContainer)
Dim cpPoint As UCOMIConnectionPoint
'Dim PES As PackageEventsSink = New PackageEventsSink
Dim guid As Guid = _
New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
cpContainer.FindConnectionPoint(guid, cpPoint)
Dim intCookie As Integer
cpPoint.Advise(PES, intCookie)
'End - set up events sink
pkg.LoadFromSQLServer("nysvrprod01", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")

'MsgBox("PACKAGE EXECUTION BEGINNING")
addListItems("PACKAGE EXECUTION BEGINNING")

pkg.Execute()

'MsgBox("PACKAGE EXECUTION COMPLETED")

addListItems("PACKAGE EXECUTION COMPLETED")

'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)

addListItems("The package contained steps." &
pkg.Steps.Count.ToString)

pkg.UnInitialize()
pkg = Nothing
cpPoint.Unadvise(intCookie)
cpPoint = Nothing
cpContainer = Nothing
PES = Nothing
Catch exc As Exception
MsgBox(exc.Message)
Finally
pkg = Nothing
'Debug.ReadLine()
End Try


Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

Nov 22 '05 #1
8 951
pSm
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:
Hi,
I followed the the aricle
http://support.microsoft.com/default...b;en-us;321525 and was able
to execute a dts package
in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
I am having is that on my form I added a listbox control
and I created a sub that added entries to the list box

Public Sub addListItems(ByVal sItem As String)

ListBox1.Items.Add(sItem)

End Sub

Then I replaced all the "msgbox" with addListItems(<message>). But form the
PackageEventsSink class how do I execute the addListItems
on form1 to add the entries to the listbox. What I tried was creating an
event in the PackageEventsSink class

Public Event Message(ByVal sMessage As String)

and I tried to raise it like

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error")

'MsgBox("Error")
End Sub

and form form1 I did the foll

declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink

and add
Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

ListBox1.Items.Add(sMessage)
Application.DoEvents()

End Sub

But when I run the program I get all the message boxes but then the program
hangs on the event. I get no error message. It just hangs.

This is the code


-------------class

Public Class PackageEventsSink
Implements DTS.PackageEvents

Public Event Message(ByVal sMessage As String)

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error") <--------------here I believe is error.

'MsgBox("Error")
End Sub
Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnFinish
MsgBox("On Finished")
End Sub
Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
ByVal ProgressDescription As String, ByVal PercentComplete As
Integer, _
ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
Integer) _
Implements DTS.PackageEvents.OnProgress

MsgBox("On Progress")
End Sub
Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
ByRef pbCancel As Boolean) Implements
DTS.PackageEvents.OnQueryCancel
If EventSource.Length > 0 Then
MsgBox("Query Cancel Yes")
Else
MsgBox("Query Cancel No")
End If
pbCancel = False
End Sub
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
MsgBox("On Start")
End Sub
End Class
--------------form 1

Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
Dim pkg As DTS.Package
Try
pkg = New DTS.Package
'Begin - set up events sink
Dim cpContainer As UCOMIConnectionPointContainer
cpContainer = CType(pkg, UCOMIConnectionPointContainer)
Dim cpPoint As UCOMIConnectionPoint
'Dim PES As PackageEventsSink = New PackageEventsSink
Dim guid As Guid = _
New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
cpContainer.FindConnectionPoint(guid, cpPoint)
Dim intCookie As Integer
cpPoint.Advise(PES, intCookie)
'End - set up events sink
pkg.LoadFromSQLServer("nysvrprod01", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")

'MsgBox("PACKAGE EXECUTION BEGINNING")
addListItems("PACKAGE EXECUTION BEGINNING")

pkg.Execute()

'MsgBox("PACKAGE EXECUTION COMPLETED")

addListItems("PACKAGE EXECUTION COMPLETED")

'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)

addListItems("The package contained steps." &
pkg.Steps.Count.ToString)

pkg.UnInitialize()
pkg = Nothing
cpPoint.Unadvise(intCookie)
cpPoint = Nothing
cpContainer = Nothing
PES = Nothing
Catch exc As Exception
MsgBox(exc.Message)
Finally
pkg = Nothing
'Debug.ReadLine()
End Try


Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

Nov 22 '05 #2
pSm
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:
Hi,
I followed the the aricle
http://support.microsoft.com/default...b;en-us;321525 and was able
to execute a dts package
in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
I am having is that on my form I added a listbox control
and I created a sub that added entries to the list box

Public Sub addListItems(ByVal sItem As String)

ListBox1.Items.Add(sItem)

End Sub

Then I replaced all the "msgbox" with addListItems(<message>). But form the
PackageEventsSink class how do I execute the addListItems
on form1 to add the entries to the listbox. What I tried was creating an
event in the PackageEventsSink class

Public Event Message(ByVal sMessage As String)

and I tried to raise it like

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error")

'MsgBox("Error")
End Sub

and form form1 I did the foll

declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink

and add
Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

ListBox1.Items.Add(sMessage)
Application.DoEvents()

End Sub

But when I run the program I get all the message boxes but then the program
hangs on the event. I get no error message. It just hangs.

This is the code


-------------class

Public Class PackageEventsSink
Implements DTS.PackageEvents

Public Event Message(ByVal sMessage As String)

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error") <--------------here I believe is error.

'MsgBox("Error")
End Sub
Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnFinish
MsgBox("On Finished")
End Sub
Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
ByVal ProgressDescription As String, ByVal PercentComplete As
Integer, _
ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
Integer) _
Implements DTS.PackageEvents.OnProgress

MsgBox("On Progress")
End Sub
Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
ByRef pbCancel As Boolean) Implements
DTS.PackageEvents.OnQueryCancel
If EventSource.Length > 0 Then
MsgBox("Query Cancel Yes")
Else
MsgBox("Query Cancel No")
End If
pbCancel = False
End Sub
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
MsgBox("On Start")
End Sub
End Class
--------------form 1

Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
Dim pkg As DTS.Package
Try
pkg = New DTS.Package
'Begin - set up events sink
Dim cpContainer As UCOMIConnectionPointContainer
cpContainer = CType(pkg, UCOMIConnectionPointContainer)
Dim cpPoint As UCOMIConnectionPoint
'Dim PES As PackageEventsSink = New PackageEventsSink
Dim guid As Guid = _
New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
cpContainer.FindConnectionPoint(guid, cpPoint)
Dim intCookie As Integer
cpPoint.Advise(PES, intCookie)
'End - set up events sink
pkg.LoadFromSQLServer("nysvrprod01", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")

'MsgBox("PACKAGE EXECUTION BEGINNING")
addListItems("PACKAGE EXECUTION BEGINNING")

pkg.Execute()

'MsgBox("PACKAGE EXECUTION COMPLETED")

addListItems("PACKAGE EXECUTION COMPLETED")

'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)

addListItems("The package contained steps." &
pkg.Steps.Count.ToString)

pkg.UnInitialize()
pkg = Nothing
cpPoint.Unadvise(intCookie)
cpPoint = Nothing
cpContainer = Nothing
PES = Nothing
Catch exc As Exception
MsgBox(exc.Message)
Finally
pkg = Nothing
'Debug.ReadLine()
End Try


Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

Nov 22 '05 #3
If I do that I get

---------------------------
WindowsApplication1
---------------------------
Object reference not set to an instance of an object.
---------------------------
OK
---------------------------

What's funny is that If I replace this

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

with

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

msgbox(sMessage)
End Sub

I get the messagebox with "Error". So it works with the messagebox. But If
I change it to add to any control like
addListItems(sMessage) or textbox1.text = sMessage

Thanks

"pSm" wrote:
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:
Hi,
I followed the the aricle
http://support.microsoft.com/default...b;en-us;321525 and was able
to execute a dts package
in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
I am having is that on my form I added a listbox control
and I created a sub that added entries to the list box

Public Sub addListItems(ByVal sItem As String)

ListBox1.Items.Add(sItem)

End Sub

Then I replaced all the "msgbox" with addListItems(<message>). But form the
PackageEventsSink class how do I execute the addListItems
on form1 to add the entries to the listbox. What I tried was creating an
event in the PackageEventsSink class

Public Event Message(ByVal sMessage As String)

and I tried to raise it like

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error")

'MsgBox("Error")
End Sub

and form form1 I did the foll

declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink

and add
Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

ListBox1.Items.Add(sMessage)
Application.DoEvents()

End Sub

But when I run the program I get all the message boxes but then the program
hangs on the event. I get no error message. It just hangs.

This is the code


-------------class

Public Class PackageEventsSink
Implements DTS.PackageEvents

Public Event Message(ByVal sMessage As String)

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error") <--------------here I believe is error.

'MsgBox("Error")
End Sub
Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnFinish
MsgBox("On Finished")
End Sub
Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
ByVal ProgressDescription As String, ByVal PercentComplete As
Integer, _
ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
Integer) _
Implements DTS.PackageEvents.OnProgress

MsgBox("On Progress")
End Sub
Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
ByRef pbCancel As Boolean) Implements
DTS.PackageEvents.OnQueryCancel
If EventSource.Length > 0 Then
MsgBox("Query Cancel Yes")
Else
MsgBox("Query Cancel No")
End If
pbCancel = False
End Sub
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
MsgBox("On Start")
End Sub
End Class
--------------form 1

Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
Dim pkg As DTS.Package
Try
pkg = New DTS.Package
'Begin - set up events sink
Dim cpContainer As UCOMIConnectionPointContainer
cpContainer = CType(pkg, UCOMIConnectionPointContainer)
Dim cpPoint As UCOMIConnectionPoint
'Dim PES As PackageEventsSink = New PackageEventsSink
Dim guid As Guid = _
New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
cpContainer.FindConnectionPoint(guid, cpPoint)
Dim intCookie As Integer
cpPoint.Advise(PES, intCookie)
'End - set up events sink
pkg.LoadFromSQLServer("nysvrprod01", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")

'MsgBox("PACKAGE EXECUTION BEGINNING")
addListItems("PACKAGE EXECUTION BEGINNING")

pkg.Execute()

'MsgBox("PACKAGE EXECUTION COMPLETED")

addListItems("PACKAGE EXECUTION COMPLETED")

'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)

addListItems("The package contained steps." &
pkg.Steps.Count.ToString)

pkg.UnInitialize()
pkg = Nothing
cpPoint.Unadvise(intCookie)
cpPoint = Nothing
cpContainer = Nothing
PES = Nothing
Catch exc As Exception
MsgBox(exc.Message)
Finally
pkg = Nothing
'Debug.ReadLine()
End Try


Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

Nov 22 '05 #4
If I do that I get

---------------------------
WindowsApplication1
---------------------------
Object reference not set to an instance of an object.
---------------------------
OK
---------------------------

What's funny is that If I replace this

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

with

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

msgbox(sMessage)
End Sub

I get the messagebox with "Error". So it works with the messagebox. But If
I change it to add to any control like
addListItems(sMessage) or textbox1.text = sMessage

Thanks

"pSm" wrote:
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:
Hi,
I followed the the aricle
http://support.microsoft.com/default...b;en-us;321525 and was able
to execute a dts package
in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
I am having is that on my form I added a listbox control
and I created a sub that added entries to the list box

Public Sub addListItems(ByVal sItem As String)

ListBox1.Items.Add(sItem)

End Sub

Then I replaced all the "msgbox" with addListItems(<message>). But form the
PackageEventsSink class how do I execute the addListItems
on form1 to add the entries to the listbox. What I tried was creating an
event in the PackageEventsSink class

Public Event Message(ByVal sMessage As String)

and I tried to raise it like

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error")

'MsgBox("Error")
End Sub

and form form1 I did the foll

declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink

and add
Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

ListBox1.Items.Add(sMessage)
Application.DoEvents()

End Sub

But when I run the program I get all the message boxes but then the program
hangs on the event. I get no error message. It just hangs.

This is the code


-------------class

Public Class PackageEventsSink
Implements DTS.PackageEvents

Public Event Message(ByVal sMessage As String)

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error") <--------------here I believe is error.

'MsgBox("Error")
End Sub
Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnFinish
MsgBox("On Finished")
End Sub
Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
ByVal ProgressDescription As String, ByVal PercentComplete As
Integer, _
ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
Integer) _
Implements DTS.PackageEvents.OnProgress

MsgBox("On Progress")
End Sub
Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
ByRef pbCancel As Boolean) Implements
DTS.PackageEvents.OnQueryCancel
If EventSource.Length > 0 Then
MsgBox("Query Cancel Yes")
Else
MsgBox("Query Cancel No")
End If
pbCancel = False
End Sub
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
MsgBox("On Start")
End Sub
End Class
--------------form 1

Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
Dim pkg As DTS.Package
Try
pkg = New DTS.Package
'Begin - set up events sink
Dim cpContainer As UCOMIConnectionPointContainer
cpContainer = CType(pkg, UCOMIConnectionPointContainer)
Dim cpPoint As UCOMIConnectionPoint
'Dim PES As PackageEventsSink = New PackageEventsSink
Dim guid As Guid = _
New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
cpContainer.FindConnectionPoint(guid, cpPoint)
Dim intCookie As Integer
cpPoint.Advise(PES, intCookie)
'End - set up events sink
pkg.LoadFromSQLServer("nysvrprod01", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")

'MsgBox("PACKAGE EXECUTION BEGINNING")
addListItems("PACKAGE EXECUTION BEGINNING")

pkg.Execute()

'MsgBox("PACKAGE EXECUTION COMPLETED")

addListItems("PACKAGE EXECUTION COMPLETED")

'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)

addListItems("The package contained steps." &
pkg.Steps.Count.ToString)

pkg.UnInitialize()
pkg = Nothing
cpPoint.Unadvise(intCookie)
cpPoint = Nothing
cpContainer = Nothing
PES = Nothing
Catch exc As Exception
MsgBox(exc.Message)
Finally
pkg = Nothing
'Debug.ReadLine()
End Try


Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

Nov 22 '05 #5
pSm
Seems like a perfect threading issue -
try writing Form1.addlistitems instead of just calling addlistitems from
PES_Message

in debugger did u check the state of the threads ?

"Chris" wrote:
If I do that I get

---------------------------
WindowsApplication1
---------------------------
Object reference not set to an instance of an object.
---------------------------
OK
---------------------------

What's funny is that If I replace this

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

with

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

msgbox(sMessage)
End Sub

I get the messagebox with "Error". So it works with the messagebox. But If
I change it to add to any control like
addListItems(sMessage) or textbox1.text = sMessage

Thanks

"pSm" wrote:
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:
Hi,
I followed the the aricle
http://support.microsoft.com/default...b;en-us;321525 and was able
to execute a dts package
in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
I am having is that on my form I added a listbox control
and I created a sub that added entries to the list box

Public Sub addListItems(ByVal sItem As String)

ListBox1.Items.Add(sItem)

End Sub

Then I replaced all the "msgbox" with addListItems(<message>). But form the
PackageEventsSink class how do I execute the addListItems
on form1 to add the entries to the listbox. What I tried was creating an
event in the PackageEventsSink class

Public Event Message(ByVal sMessage As String)

and I tried to raise it like

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error")

'MsgBox("Error")
End Sub

and form form1 I did the foll

declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink

and add
Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

ListBox1.Items.Add(sMessage)
Application.DoEvents()

End Sub

But when I run the program I get all the message boxes but then the program
hangs on the event. I get no error message. It just hangs.

This is the code


-------------class

Public Class PackageEventsSink
Implements DTS.PackageEvents

Public Event Message(ByVal sMessage As String)

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error") <--------------here I believe is error.

'MsgBox("Error")
End Sub
Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnFinish
MsgBox("On Finished")
End Sub
Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
ByVal ProgressDescription As String, ByVal PercentComplete As
Integer, _
ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
Integer) _
Implements DTS.PackageEvents.OnProgress

MsgBox("On Progress")
End Sub
Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
ByRef pbCancel As Boolean) Implements
DTS.PackageEvents.OnQueryCancel
If EventSource.Length > 0 Then
MsgBox("Query Cancel Yes")
Else
MsgBox("Query Cancel No")
End If
pbCancel = False
End Sub
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
MsgBox("On Start")
End Sub
End Class
--------------form 1

Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
Dim pkg As DTS.Package
Try
pkg = New DTS.Package
'Begin - set up events sink
Dim cpContainer As UCOMIConnectionPointContainer
cpContainer = CType(pkg, UCOMIConnectionPointContainer)
Dim cpPoint As UCOMIConnectionPoint
'Dim PES As PackageEventsSink = New PackageEventsSink
Dim guid As Guid = _
New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
cpContainer.FindConnectionPoint(guid, cpPoint)
Dim intCookie As Integer
cpPoint.Advise(PES, intCookie)
'End - set up events sink
pkg.LoadFromSQLServer("nysvrprod01", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")

'MsgBox("PACKAGE EXECUTION BEGINNING")
addListItems("PACKAGE EXECUTION BEGINNING")

pkg.Execute()

'MsgBox("PACKAGE EXECUTION COMPLETED")

addListItems("PACKAGE EXECUTION COMPLETED")

'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)

addListItems("The package contained steps." &
pkg.Steps.Count.ToString)

pkg.UnInitialize()
pkg = Nothing
cpPoint.Unadvise(intCookie)
cpPoint = Nothing
cpContainer = Nothing
PES = Nothing
Catch exc As Exception
MsgBox(exc.Message)
Finally
pkg = Nothing
'Debug.ReadLine()
End Try


Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

Nov 22 '05 #6
pSm
Seems like a perfect threading issue -
try writing Form1.addlistitems instead of just calling addlistitems from
PES_Message

in debugger did u check the state of the threads ?

"Chris" wrote:
If I do that I get

---------------------------
WindowsApplication1
---------------------------
Object reference not set to an instance of an object.
---------------------------
OK
---------------------------

What's funny is that If I replace this

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

with

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

msgbox(sMessage)
End Sub

I get the messagebox with "Error". So it works with the messagebox. But If
I change it to add to any control like
addListItems(sMessage) or textbox1.text = sMessage

Thanks

"pSm" wrote:
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:
Hi,
I followed the the aricle
http://support.microsoft.com/default...b;en-us;321525 and was able
to execute a dts package
in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
I am having is that on my form I added a listbox control
and I created a sub that added entries to the list box

Public Sub addListItems(ByVal sItem As String)

ListBox1.Items.Add(sItem)

End Sub

Then I replaced all the "msgbox" with addListItems(<message>). But form the
PackageEventsSink class how do I execute the addListItems
on form1 to add the entries to the listbox. What I tried was creating an
event in the PackageEventsSink class

Public Event Message(ByVal sMessage As String)

and I tried to raise it like

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error")

'MsgBox("Error")
End Sub

and form form1 I did the foll

declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink

and add
Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

ListBox1.Items.Add(sMessage)
Application.DoEvents()

End Sub

But when I run the program I get all the message boxes but then the program
hangs on the event. I get no error message. It just hangs.

This is the code


-------------class

Public Class PackageEventsSink
Implements DTS.PackageEvents

Public Event Message(ByVal sMessage As String)

Overridable Overloads Sub OnError(ByVal EventSource As String, _
ByVal ErrorCode As Integer, ByVal Source As String, _
ByVal Description As String, ByVal HelpFile As String, _
ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
String, _
ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError

RaiseEvent Message("Error") <--------------here I believe is error.

'MsgBox("Error")
End Sub
Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnFinish
MsgBox("On Finished")
End Sub
Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
ByVal ProgressDescription As String, ByVal PercentComplete As
Integer, _
ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
Integer) _
Implements DTS.PackageEvents.OnProgress

MsgBox("On Progress")
End Sub
Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
ByRef pbCancel As Boolean) Implements
DTS.PackageEvents.OnQueryCancel
If EventSource.Length > 0 Then
MsgBox("Query Cancel Yes")
Else
MsgBox("Query Cancel No")
End If
pbCancel = False
End Sub
Overridable Overloads Sub OnStart(ByVal EventSource As String) _
Implements DTS.PackageEvents.OnStart
MsgBox("On Start")
End Sub
End Class
--------------form 1

Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
Dim pkg As DTS.Package
Try
pkg = New DTS.Package
'Begin - set up events sink
Dim cpContainer As UCOMIConnectionPointContainer
cpContainer = CType(pkg, UCOMIConnectionPointContainer)
Dim cpPoint As UCOMIConnectionPoint
'Dim PES As PackageEventsSink = New PackageEventsSink
Dim guid As Guid = _
New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
cpContainer.FindConnectionPoint(guid, cpPoint)
Dim intCookie As Integer
cpPoint.Advise(PES, intCookie)
'End - set up events sink
pkg.LoadFromSQLServer("nysvrprod01", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")

'MsgBox("PACKAGE EXECUTION BEGINNING")
addListItems("PACKAGE EXECUTION BEGINNING")

pkg.Execute()

'MsgBox("PACKAGE EXECUTION COMPLETED")

addListItems("PACKAGE EXECUTION COMPLETED")

'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)

addListItems("The package contained steps." &
pkg.Steps.Count.ToString)

pkg.UnInitialize()
pkg = Nothing
cpPoint.Unadvise(intCookie)
cpPoint = Nothing
cpContainer = Nothing
PES = Nothing
Catch exc As Exception
MsgBox(exc.Message)
Finally
pkg = Nothing
'Debug.ReadLine()
End Try


Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

Nov 22 '05 #7
I tried this

me.addListItems(sMessage)
because form1 didn't list the sub. How do I check the state of the threads?

"pSm" wrote:
Seems like a perfect threading issue -
try writing Form1.addlistitems instead of just calling addlistitems from
PES_Message

in debugger did u check the state of the threads ?

"Chris" wrote:
If I do that I get

---------------------------
WindowsApplication1
---------------------------
Object reference not set to an instance of an object.
---------------------------
OK
---------------------------

What's funny is that If I replace this

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

with

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

msgbox(sMessage)
End Sub

I get the messagebox with "Error". So it works with the messagebox. But If
I change it to add to any control like
addListItems(sMessage) or textbox1.text = sMessage

Thanks

"pSm" wrote:
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:

> Hi,
> I followed the the aricle
> http://support.microsoft.com/default...b;en-us;321525 and was able
> to execute a dts package
> in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
> I am having is that on my form I added a listbox control
> and I created a sub that added entries to the list box
>
> Public Sub addListItems(ByVal sItem As String)
>
> ListBox1.Items.Add(sItem)
>
> End Sub
>
> Then I replaced all the "msgbox" with addListItems(<message>). But form the
> PackageEventsSink class how do I execute the addListItems
> on form1 to add the entries to the listbox. What I tried was creating an
> event in the PackageEventsSink class
>
> Public Event Message(ByVal sMessage As String)
>
> and I tried to raise it like
>
> Overridable Overloads Sub OnError(ByVal EventSource As String, _
> ByVal ErrorCode As Integer, ByVal Source As String, _
> ByVal Description As String, ByVal HelpFile As String, _
> ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
> String, _
> ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError
>
> RaiseEvent Message("Error")
>
> 'MsgBox("Error")
> End Sub
>
> and form form1 I did the foll
>
> declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
>
> and add
>
>
> Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message
>
> ListBox1.Items.Add(sMessage)
> Application.DoEvents()
>
> End Sub
>
> But when I run the program I get all the message boxes but then the program
> hangs on the event. I get no error message. It just hangs.
>
> This is the code
>
>
>
>
> -------------class
>
> Public Class PackageEventsSink
> Implements DTS.PackageEvents
>
> Public Event Message(ByVal sMessage As String)
>
> Overridable Overloads Sub OnError(ByVal EventSource As String, _
> ByVal ErrorCode As Integer, ByVal Source As String, _
> ByVal Description As String, ByVal HelpFile As String, _
> ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
> String, _
> ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError
>
> RaiseEvent Message("Error") <--------------here I believe is error.
>
> 'MsgBox("Error")
> End Sub
> Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
> Implements DTS.PackageEvents.OnFinish
> MsgBox("On Finished")
> End Sub
> Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
> ByVal ProgressDescription As String, ByVal PercentComplete As
> Integer, _
> ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
> Integer) _
> Implements DTS.PackageEvents.OnProgress
>
> MsgBox("On Progress")
> End Sub
> Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
> ByRef pbCancel As Boolean) Implements
> DTS.PackageEvents.OnQueryCancel
> If EventSource.Length > 0 Then
> MsgBox("Query Cancel Yes")
> Else
> MsgBox("Query Cancel No")
> End If
> pbCancel = False
> End Sub
> Overridable Overloads Sub OnStart(ByVal EventSource As String) _
> Implements DTS.PackageEvents.OnStart
> MsgBox("On Start")
> End Sub
>
>
> End Class
>
>
> --------------form 1
>
>
>
> Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
>
>
> Dim pkg As DTS.Package
> Try
> pkg = New DTS.Package
> 'Begin - set up events sink
> Dim cpContainer As UCOMIConnectionPointContainer
> cpContainer = CType(pkg, UCOMIConnectionPointContainer)
> Dim cpPoint As UCOMIConnectionPoint
> 'Dim PES As PackageEventsSink = New PackageEventsSink
> Dim guid As Guid = _
> New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
> cpContainer.FindConnectionPoint(guid, cpPoint)
> Dim intCookie As Integer
> cpPoint.Advise(PES, intCookie)
> 'End - set up events sink
> pkg.LoadFromSQLServer("nysvrprod01", "", "",
> DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")
>
> 'MsgBox("PACKAGE EXECUTION BEGINNING")
> addListItems("PACKAGE EXECUTION BEGINNING")
>
> pkg.Execute()
>
> 'MsgBox("PACKAGE EXECUTION COMPLETED")
>
> addListItems("PACKAGE EXECUTION COMPLETED")
>
> 'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)
>
> addListItems("The package contained steps." &
> pkg.Steps.Count.ToString)
>
> pkg.UnInitialize()
> pkg = Nothing
> cpPoint.Unadvise(intCookie)
> cpPoint = Nothing
> cpContainer = Nothing
> PES = Nothing
> Catch exc As Exception
> MsgBox(exc.Message)
> Finally
> pkg = Nothing
> 'Debug.ReadLine()
> End Try
>
>
>
>
> Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message
>
> addListItems(sMessage)
> Application.DoEvents()
>
> End Sub
>

Nov 22 '05 #8
I tried this

me.addListItems(sMessage)
because form1 didn't list the sub. How do I check the state of the threads?

"pSm" wrote:
Seems like a perfect threading issue -
try writing Form1.addlistitems instead of just calling addlistitems from
PES_Message

in debugger did u check the state of the threads ?

"Chris" wrote:
If I do that I get

---------------------------
WindowsApplication1
---------------------------
Object reference not set to an instance of an object.
---------------------------
OK
---------------------------

What's funny is that If I replace this

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

addListItems(sMessage)
Application.DoEvents()

End Sub

with

Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message

msgbox(sMessage)
End Sub

I get the messagebox with "Error". So it works with the messagebox. But If
I change it to add to any control like
addListItems(sMessage) or textbox1.text = sMessage

Thanks

"pSm" wrote:
Chris, try removing "= New PackageEventsSink"

Did u try debugging ? Code looks ok to me .

"Chris" wrote:

> Hi,
> I followed the the aricle
> http://support.microsoft.com/default...b;en-us;321525 and was able
> to execute a dts package
> in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem
> I am having is that on my form I added a listbox control
> and I created a sub that added entries to the list box
>
> Public Sub addListItems(ByVal sItem As String)
>
> ListBox1.Items.Add(sItem)
>
> End Sub
>
> Then I replaced all the "msgbox" with addListItems(<message>). But form the
> PackageEventsSink class how do I execute the addListItems
> on form1 to add the entries to the listbox. What I tried was creating an
> event in the PackageEventsSink class
>
> Public Event Message(ByVal sMessage As String)
>
> and I tried to raise it like
>
> Overridable Overloads Sub OnError(ByVal EventSource As String, _
> ByVal ErrorCode As Integer, ByVal Source As String, _
> ByVal Description As String, ByVal HelpFile As String, _
> ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
> String, _
> ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError
>
> RaiseEvent Message("Error")
>
> 'MsgBox("Error")
> End Sub
>
> and form form1 I did the foll
>
> declared Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
>
> and add
>
>
> Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message
>
> ListBox1.Items.Add(sMessage)
> Application.DoEvents()
>
> End Sub
>
> But when I run the program I get all the message boxes but then the program
> hangs on the event. I get no error message. It just hangs.
>
> This is the code
>
>
>
>
> -------------class
>
> Public Class PackageEventsSink
> Implements DTS.PackageEvents
>
> Public Event Message(ByVal sMessage As String)
>
> Overridable Overloads Sub OnError(ByVal EventSource As String, _
> ByVal ErrorCode As Integer, ByVal Source As String, _
> ByVal Description As String, ByVal HelpFile As String, _
> ByVal HelpContext As Integer, ByVal IDofInterfaceWithError As
> String, _
> ByRef pbCancel As Boolean) Implements DTS.PackageEvents.OnError
>
> RaiseEvent Message("Error") <--------------here I believe is error.
>
> 'MsgBox("Error")
> End Sub
> Overridable Overloads Sub OnFinish(ByVal EventSource As String) _
> Implements DTS.PackageEvents.OnFinish
> MsgBox("On Finished")
> End Sub
> Overridable Overloads Sub OnProgress(ByVal EventSource As String, _
> ByVal ProgressDescription As String, ByVal PercentComplete As
> Integer, _
> ByVal ProgressCountLow As Integer, ByVal ProgressCountHigh As
> Integer) _
> Implements DTS.PackageEvents.OnProgress
>
> MsgBox("On Progress")
> End Sub
> Overridable Overloads Sub OnQueryCancel(ByVal EventSource As String, _
> ByRef pbCancel As Boolean) Implements
> DTS.PackageEvents.OnQueryCancel
> If EventSource.Length > 0 Then
> MsgBox("Query Cancel Yes")
> Else
> MsgBox("Query Cancel No")
> End If
> pbCancel = False
> End Sub
> Overridable Overloads Sub OnStart(ByVal EventSource As String) _
> Implements DTS.PackageEvents.OnStart
> MsgBox("On Start")
> End Sub
>
>
> End Class
>
>
> --------------form 1
>
>
>
> Dim WithEvents PES As PackageEventsSink = New PackageEventsSink
>
>
> Dim pkg As DTS.Package
> Try
> pkg = New DTS.Package
> 'Begin - set up events sink
> Dim cpContainer As UCOMIConnectionPointContainer
> cpContainer = CType(pkg, UCOMIConnectionPointContainer)
> Dim cpPoint As UCOMIConnectionPoint
> 'Dim PES As PackageEventsSink = New PackageEventsSink
> Dim guid As Guid = _
> New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")
> cpContainer.FindConnectionPoint(guid, cpPoint)
> Dim intCookie As Integer
> cpPoint.Advise(PES, intCookie)
> 'End - set up events sink
> pkg.LoadFromSQLServer("nysvrprod01", "", "",
> DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , "New Package")
>
> 'MsgBox("PACKAGE EXECUTION BEGINNING")
> addListItems("PACKAGE EXECUTION BEGINNING")
>
> pkg.Execute()
>
> 'MsgBox("PACKAGE EXECUTION COMPLETED")
>
> addListItems("PACKAGE EXECUTION COMPLETED")
>
> 'MsgBox("The package contained steps." & pkg.Steps.Count.ToString)
>
> addListItems("The package contained steps." &
> pkg.Steps.Count.ToString)
>
> pkg.UnInitialize()
> pkg = Nothing
> cpPoint.Unadvise(intCookie)
> cpPoint = Nothing
> cpContainer = Nothing
> PES = Nothing
> Catch exc As Exception
> MsgBox(exc.Message)
> Finally
> pkg = Nothing
> 'Debug.ReadLine()
> End Try
>
>
>
>
> Private Sub PES_Message(ByVal sMessage As String) Handles PES.Message
>
> addListItems(sMessage)
> Application.DoEvents()
>
> End Sub
>

Nov 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: serge calderara | last post by:
Dear all, I have a class wich is raising events as normally it should do. having a form in the same assembly wich is catching those events works fne. Raise events gets catch normaly within the...
4
by: Chris | last post by:
Hi, I followed the the aricle http://support.microsoft.com/default.aspx?scid=kb;en-us;321525 and was able to execute a dts package in vb.net. I replaced all the "Console.WriteLine" with "msgbox"....
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
7
by: cider123 | last post by:
I'm coding a project using the following article as reference: http://www.codeproject.com/csharp/DynamicPluginManager.asp In this type of project, plugins are loaded dynamically into a Plugin...
22
by: Jeff Louie | last post by:
Well I wonder if my old brain can handle threading. Dose this code look reasonable. Regards, Jeff using System; using System.Diagnostics; using System.IO; using System.Threading;
1
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following...
2
by: Gman | last post by:
Hi, I have created a usercontrol, a grid control essentially. Within it I have a class: clsGridRecord. I have coded the events such that when a user clicks on the grid, say, the events occur on...
3
by: George | last post by:
Hi, I have searched on the net quite a bit, but the more I read, the more confused I get. I want to see if I can raise an event out side of the class. I believe this can be done in VB (at...
3
by: Smithers | last post by:
In consideration of the brief sample code at the following link... http://msdn2.microsoft.com/en-us/library/system.componentmodel.canceleventargs.cancel.aspx .... when we set e.Cancel = true,...
7
by: SetonSoftware | last post by:
I have a class with shared properties and methods that manages the open forms in my WinForms application, VB.NET 2005. The data contained within must persist for the lifetime of the application....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.