IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB.NET Discussion :

Une erreur embêtante, Impossible d'éffectuer un cast


Sujet :

VB.NET

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Invité
    Invité(e)
    Par défaut Une erreur embêtante, Impossible d'éffectuer un cast
    Bonjour,

    Ca fait plusieurs jours que je n'arrive pas à régler une erreur, la voici:
    Impossible d'effectuer un cast d'un objet de type 'WindowsApplication1.com.ankamagames.dofus.network.types.game.context.roleplay.quest.GameRolePlayNpcQuestFlag' en type 'WindowsApplication1.com.ankamagames.dofus.network.types.game.context.roleplay.GameRolePlayActorInformations'.
    Voici sur quel ligne elle se produit:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    _loc_17 = ProtocolTypeManager.GetInstance(_loc_16)
    Voilà ma class:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    Imports WindowsApplication1.com.ankamagames.dofus.network.types.game.house
    Imports WindowsApplication1.Dofus
    Imports WindowsApplication1.com.ankamagames.dofus.network.types.game.context.roleplay
    Imports WindowsApplication1.com.ankamagames.dofus.network.types.game.context.fight
    Imports WindowsApplication1.com.ankamagames.dofus.network.types.game.integereractive
    Imports WindowsApplication1.com.ankamagames.dofus.network.types.game.context.roleplay.quest
     
    Namespace com.ankamagames.dofus.network.messages.game.context.roleplay
        Public Class MapComplementaryInformationsDataMessage
     
            Private _isInitialized As Boolean = False
            Public subAreaId As UInteger = 0
            Public mapId As UInteger = 0
            Public subareaAlignmentSide As Integer = 0
            Public houses As New List(Of HouseInformations)
            Public actors As New List(Of GameRolePlayActorInformations)
            Public integereractiveElements As New List(Of InteractiveElement)
            Public statedElements As New List(Of StatedElement)
            Public obstacles As New List(Of MapObstacle)
            Public fights As New List(Of FightCommonInformations)
            Public protocolId As UInteger = 226
            Public var As New List(Of GameRolePlayNpcQuestFlag)
     
            Public Function MapComplementaryInformationsDataMessage()
     
                Me.houses = New List(Of HouseInformations)
                Me.actors = New List(Of GameRolePlayActorInformations)
                Me.integereractiveElements = New List(Of InteractiveElement)
                Me.statedElements = New List(Of StatedElement)
                Me.obstacles = New List(Of MapObstacle)
                Me.fights = New List(Of FightCommonInformations)
                Return Me
            End Function
     
            Public Overridable Function get_isInitialized() As Boolean
     
                Return Me._isInitialized
            End Function
     
            Public Overridable Function getMessageId() As UInteger
     
                Return 226
            End Function
     
            Public Function initMapComplementaryInformationsDataMessage(ByVal param1 As UInteger, ByVal param2 As UInteger, ByVal param3 As Integer, ByVal param4 As List(Of HouseInformations), ByVal param5 As List(Of GameRolePlayActorInformations), ByVal param6 As List(Of InteractiveElement), ByVal param7 As List(Of StatedElement), ByVal param8 As List(Of MapObstacle), ByVal param9 As List(Of FightCommonInformations)) As MapComplementaryInformationsDataMessage
     
                Me.subAreaId = param1
                Me.mapId = param2
                Me.subareaAlignmentSide = param3
                Me.houses = param4
                Me.actors = param5
                Me.integereractiveElements = param6
                Me.statedElements = param7
                Me.obstacles = param8
                Me.fights = param9
                Me._isInitialized = True
                Return Me
            End Function
     
            Public Overridable Function reset()
     
                Me.subAreaId = 0
                Me.mapId = 0
                Me.subareaAlignmentSide = 0
                Me.houses = New List(Of HouseInformations)
                Me.actors = New List(Of GameRolePlayActorInformations)
                Me.integereractiveElements = New List(Of InteractiveElement)
                Me.statedElements = New List(Of StatedElement)
                Me.obstacles = New List(Of MapObstacle)
                Me.fights = New List(Of FightCommonInformations)
                Me._isInitialized = False
                Return Me
            End Function
     
            Public Function pack(ByVal Sock As System.Net.Sockets.Socket)
                Dim writer As New DofusWriter()
                Me.serialize(writer)
                DofusWriter.Send(protocolId, Sock)
                Return Me
            End Function
     
            Public Overridable Function unpack(ByVal param1 As DofusReader, ByVal param2 As UInteger)
     
                Me.deserialize(param1)
                Return Me
            End Function
     
            Public Function serialize(ByVal param1 As DofusWriter)
     
                Me.serializeAs_MapComplementaryInformationsDataMessage(param1)
                Return Me
            End Function
     
            Public Function serializeAs_MapComplementaryInformationsDataMessage(ByVal param1 As DofusWriter)
                param1.WriteShort(Me.subAreaId)
                param1.WriteInt32(Me.mapId)
                param1.WriteByte(Me.subareaAlignmentSide)
                param1.WriteShort(Me.houses.Count)
                Dim _loc_2 As UInteger = 0
                While (_loc_2 < Me.houses.Count)
     
     
                    param1.WriteShort(Me.houses(_loc_2).getTypeId())
                    Me.houses(_loc_2).serialize(param1)
                    _loc_2 = _loc_2 + 1
                End While
     
                param1.WriteShort(Me.actors.Count)
                Dim _loc_3 As UInteger = 0
                While (_loc_3 < Me.actors.Count)
     
     
                    param1.WriteShort(Me.actors(_loc_3).getTypeId())
                    Me.actors(_loc_3).serialize(param1)
                    _loc_3 = _loc_3 + 1
                End While
                param1.WriteShort(Me.integereractiveElements.Count)
                Dim _loc_4 As UInteger = 0
                While (_loc_4 < Me.integereractiveElements.Count)
     
     
                    Me.integereractiveElements(_loc_4).serializeAs_InteractiveElement(param1)
                    _loc_4 = _loc_4 + 1
                End While
                param1.WriteShort(Me.statedElements.Count)
                Dim _loc_5 As UInteger = 0
                While (_loc_5 < Me.statedElements.Count)
     
     
                    Me.statedElements(_loc_5).serializeAs_StatedElement(param1)
                    _loc_5 = _loc_5 + 1
                End While
                param1.WriteShort(Me.obstacles.Count)
                Dim _loc_6 As UInteger = 0
                While (_loc_6 < Me.obstacles.Count)
     
     
                    Me.obstacles(_loc_6).serializeAs_MapObstacle(param1)
                    _loc_6 = _loc_6 + 1
                End While
                param1.WriteShort(Me.fights.Count)
                Dim _loc_7 As UInteger = 0
                While (_loc_7 < Me.fights.Count)
     
     
                    Me.fights(_loc_7).serializeAs_FightCommonInformations(param1)
                    _loc_7 = _loc_7 + 1
                End While
                Return Me
            End Function
     
            Public Function deserialize(ByVal param1 As DofusReader)
     
                Me.deserializeAs_MapComplementaryInformationsDataMessage(param1)
                Return Me
            End Function
     
            Public Function deserializeAs_MapComplementaryInformationsDataMessage(ByVal param1 As DofusReader)
     
                Dim _loc_14 As UInteger = 0
                Dim _loc_15 As HouseInformations = Nothing
                Dim _loc_16 As UInteger = 0
                Dim _loc_17 As GameRolePlayActorInformations = Nothing
                Dim _loc_18 As InteractiveElement = Nothing
                Dim _loc_19 As StatedElement = Nothing
                Dim _loc_20 As MapObstacle = Nothing
                Dim _loc_21 As FightCommonInformations = Nothing
                Dim var As GameRolePlayNpcQuestFlag = Nothing
     
                Me.subAreaId = param1.ReadShort()
                Me.mapId = param1.ReadInt()
                Me.subareaAlignmentSide = param1.ReadByte()
                Dim _loc_2 As UShort = param1.ReadUnSignedshort()
                Dim _loc_3 As UInteger = 0
                While (_loc_3 < _loc_2)
     
     
                    _loc_14 = param1.ReadUnSignedshort()
                    _loc_15 = ProtocolTypeManager.GetInstance(_loc_14)
                    _loc_15.deserialize(param1)
                    Me.houses.Add(_loc_15)
                    _loc_3 = _loc_3 + 1
                End While
                Dim _loc_4 As UShort = param1.ReadUnSignedshort()
                Dim _loc_5 As UInteger = 0
                While (_loc_5 < _loc_4)
     
     
                    _loc_16 = param1.ReadUnSignedshort()
                    _loc_17 = ProtocolTypeManager.GetInstance(_loc_16)
                    _loc_17.deserialize(param1)
                    Me.actors.Add(_loc_17)
                    _loc_5 = _loc_5 + 1
                End While
                Dim _loc_6 As UShort = param1.ReadUnSignedshort()
                Dim _loc_7 As UInteger = 0
                While (_loc_7 < _loc_6)
     
     
                    _loc_18 = New InteractiveElement()
                    _loc_18.deserialize(param1)
                    Me.integereractiveElements.Add(_loc_18)
                    _loc_7 = _loc_7 + 1
                End While
                Dim _loc_8 As UShort = param1.ReadUnSignedshort()
                Dim _loc_9 As UInteger = 0
                While (_loc_9 < _loc_8)
     
     
                    _loc_19 = New StatedElement()
                    _loc_19.deserialize(param1)
                    Me.statedElements.Add(_loc_19)
                    _loc_9 = _loc_9 + 1
                End While
                Dim _loc_10 As UShort = param1.ReadUnSignedshort()
                Dim _loc_11 As UInteger = 0
                While (_loc_11 < _loc_10)
     
     
                    _loc_20 = New MapObstacle()
                    _loc_20.deserialize(param1)
                    Me.obstacles.Add(_loc_20)
                    _loc_11 = _loc_11 + 1
                End While
                Dim _loc_12 As UShort = param1.ReadUnSignedshort()
                Dim _loc_13 As UInteger = 0
                While (_loc_13 < _loc_12)
     
     
                    _loc_21 = New FightCommonInformations()
                    _loc_21.deserialize(param1)
                    Me.fights.Add(_loc_21)
                    _loc_13 = _loc_13 + 1
                End While
                Return Me
            End Function
     
        End Class
    End Namespace
    Merci à vous
    Dernière modification par Deepin ; 26/12/2011 à 11h06. Motif: Balises [CODE]...[/CODE] au lieu de [QUOTE]...[/QUOTE]

Discussions similaires

  1. mises-à-jour impossibles: dpkg indique une erreur
    Par Celano dans le forum Administration système
    Réponses: 5
    Dernier message: 02/03/2012, 18h30
  2. erreur impossible d'effectuer un cast?
    Par gilles_906 dans le forum VB.NET
    Réponses: 6
    Dernier message: 04/04/2011, 22h51
  3. Réponses: 0
    Dernier message: 16/08/2010, 12h24
  4. Réponses: 1
    Dernier message: 04/05/2010, 21h29
  5. Impossible d'attraper une erreur
    Par jagboys dans le forum C++Builder
    Réponses: 2
    Dernier message: 16/06/2005, 00h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo