Hi,
I have two structures. One containing(EmailMessage) an array of the
other(AttFile). When I try to work with in my VB.NET app iIalways receive an
error off this type Object reference not set to an instance of an object.
This is my code. ANy help please!!!!
Public Structure EmailMessage
Public FichsAttaches() As FichierAttaches
Public DestinataireCourriel As String
Public ExpediteurCourriel As String
Public CCDestinataireCourriel As String
Public SujetCourriel As String
Public MsgCourriel As String
Public ImportanceCourriel As ImportanceCourl
Public FormatCourriel As FormatMessage
Public EncodageCourriel As TypeEncodage
End Structure
Public Structure AttFile
Public NomFichierAttache As String
Public FichierAttache() As Byte
End Structure
Dim objEmail As New localhost.EmailMessage
Dim objFichAtch As New localhost.AttFile
Dim strNomFich As String = "README.txt"
Try
objEmail.ExpediteurCourriel = "blabla"
objEmail.DestinataireCourriel = "blabla"
objEmail.CCDestinataireCourriel = ""
objEmail.SujetCourriel = "Test"
objEmail.MsgCourriel = "Goodddddddddd"
objEmail.FormatCourriel =
CType(System.Enum.Parse(GetType(localhost.FormatMe ssage),
cboFormat.SelectedItem.ToString()), localhost.FormatMessage)
objEmail.EncodageCourriel =
CType(System.Enum.Parse(GetType(localhost.TypeEnco dage),
Me.cboEncodage.SelectedItem.ToString()), localhost.TypeEncodage)
objEmail.ImportanceCourriel =
CType(System.Enum.Parse(GetType(localhost.Importan ceCourl),
cboImpor.SelectedItem.ToString()), localhost.ImportanceCourl)
objFichAtch.FichierAttache = AjouterAtch(strNomFich, "C:\")
objFichAtch.NomFichierAttache = strNomFich
objEmail.FichiersAttaches(0) = objFichAtch ---> Here where the
error occur
************************************************** ****************
Catch ex As soapException
MessageBox.Show(ex.Message)
End Try