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

VBA Discussion :

Code trop obscur


Sujet :

VBA

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2017
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Transports

    Informations forums :
    Inscription : Août 2017
    Messages : 5
    Points : 2
    Points
    2
    Par défaut Code trop obscur
    salut tOUt le monde

    svp POURRIEZ-VOUS M'expliquer moi ce code S'IL VOUS PLAIT ?

    merci
    -----------
    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
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    Private Sub Command7_Click() '4D2310
      Dim var_5C As TextBox
      Dim var_C0 As TextBox
      Dim var_60 As TextBox
      Dim var_C8 As TextBox
      var_C = ""
      var_8 = &H402F58
      var_eax = arg_8.AddRef 'Ignore this
      ebx = ""
      var_24 = ""
      var_34 = ""
      var_44 = ""
      var_48 = ""
      var_4C = ""
      var_50 = ""
      var_54 = ""
      var_58 = ""
      var_5C = ""
      var_60 = ""
      var_64 = ""
      var_74 = ""
      var_84 = ""
      var_94 = ""
      var_A4 = ""
      var_B4 = ""
      var_eax = serie.Text4 'Ignore this
      Set var_5C = serie.Text4
      var_B8 = var_5C
      var_48 = Text4.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_B8, var_00417640, 160)
      End If
      var_eax = serie.Text5 'Ignore this
      Set var_60 = serie.Text5
      var_C0 = var_60
      var_6C = var_48
      var_7C = 1
      var_84 = 2
      var_48 = ""
      var_74 = 8
      var_94 = Mid(var_48, 1, 1)
      var_4C = CStr(var_94)
      var_50 = CStr(Asc(var_4C))
      Text5.Text = var_50
      If var_50 < 0 Then
        var_50 = CheckObj(var_C0, var_00417640, 164)
      End If
      call undef 'Ignore this '__vbaFreeVarList(00000003, var_74, var_84, var_94, arg_8, arg_8, Set %StkVar1 = %StkVar2, arg_8, var_C0)
      var_eax = serie.Text4 'Ignore this
      Set var_60 = serie.Text4
      var_4C = Text4.Text
      If var_4C < 0 Then
        var_4C = CheckObj(var_60, var_00417640, 160)
      End If
      var_eax = serie.Text5 'Ignore this
      Set var_64 = serie.Text5
      var_C8 = var_64
      var_eax = serie.Text5 'Ignore this
      Set var_5C = serie.Text5
      var_48 = Text5.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_5C, var_00417640, 160)
      End If
      var_6C = var_4C
      var_7C = 1
      var_84 = 2
      var_4C = 0
      var_74 = 8
      var_94 = Mid(var_4C, 2, 1)
      var_50 = CStr(var_94)
      var_54 = CStr(Asc(var_50))
      var_58 = var_48 & var_54
      Text5.Text = var_58
      If var_58 < 0 Then
        var_58 = CheckObj(var_C8, var_00417640, 164)
      End If
      var_58 = ""
      call undef 'Ignore this '__vbaFreeVarList(00000003, var_74, var_84, var_94, arg_8, arg_8, arg_8)
      var_eax = serie.Text4 'Ignore this
      Set var_60 = serie.Text4
      var_4C = Text4.Text
      If var_4C < 0 Then
        var_4C = CheckObj(var_60, var_00417640, 160)
      End If
      var_eax = serie.Text5 'Ignore this
      Set var_64 = serie.Text5
      var_C8 = var_64
      var_eax = serie.Text5 'Ignore this
      Set var_5C = serie.Text5
      var_48 = Text5.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_5C, var_00417640, 160)
      End If
      var_6C = var_4C
      var_7C = 1
      var_84 = 2
      var_4C = 0
      var_74 = 8
      var_94 = Mid(var_4C, 3, 1)
      var_50 = CStr(var_94)
      var_54 = CStr(Asc(var_50))
      var_58 = var_48 & var_54
      var_104 = var_48 & var_54
      Text5.Text = var_58
      If var_104 < 0 Then
        var_104 = CheckObj(var_C8, var_00417640, 164)
      End If
      var_58 = ""
      call undef 'Ignore this '__vbaFreeVarList(00000003, var_74, var_84, var_94, arg_8, arg_8, arg_8)
      var_eax = serie.Text4 'Ignore this
      Set var_60 = serie.Text4
      var_4C = Text4.Text
      If var_4C < 0 Then
        var_4C = CheckObj(var_60, var_00417640, 160)
      End If
      var_eax = serie.Text5 'Ignore this
      Set var_64 = serie.Text5
      var_C8 = var_64
      var_eax = serie.Text5 'Ignore this
      Set var_5C = serie.Text5
      var_48 = Text5.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_5C, var_00417640, 160)
      End If
      var_6C = var_4C
      var_7C = 1
      var_84 = 2
      var_4C = 0
      var_74 = 8
      var_94 = Mid(var_4C, 4, 1)
      var_50 = CStr(var_94)
      var_54 = CStr(Asc(var_50))
      var_58 = var_48 & var_54
      Text5.Text = var_58
      If var_58 < 0 Then
        var_58 = CheckObj(var_C8, var_00417640, 164)
      End If
      var_58 = ""
      call undef 'Ignore this '__vbaFreeVarList(00000003, var_74, var_84, var_94, arg_8, arg_8, arg_8)
      var_eax = serie.Text4 'Ignore this
      Set var_60 = serie.Text4
      var_4C = Text4.Text
      If var_4C < 0 Then
        var_4C = CheckObj(var_60, var_00417640, 160)
      End If
      var_eax = serie.Text5 'Ignore this
      Set var_64 = serie.Text5
      var_C8 = var_64
      var_eax = serie.Text5 'Ignore this
      Set var_5C = serie.Text5
      var_48 = Text5.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_5C, var_00417640, 160)
      End If
      var_6C = var_4C
      var_7C = 1
      var_84 = 2
      var_4C = 0
      var_74 = 8
      var_94 = Mid(var_4C, 5, 1)
      var_50 = CStr(var_94)
      var_54 = CStr(Asc(var_50))
      var_58 = var_48 & var_54
      Text5.Text = var_58
      If var_58 < 0 Then
        var_58 = CheckObj(var_C8, var_00417640, 164)
      End If
      var_58 = ""
      call undef 'Ignore this '__vbaFreeVarList(00000003, var_74, var_84, var_94, arg_8, arg_8, arg_8)
      var_eax = serie.Text4 'Ignore this
      Set var_60 = serie.Text4
      var_4C = Text4.Text
      If var_4C < 0 Then
        var_4C = CheckObj(var_60, var_00417640, 160)
      End If
      var_eax = serie.Text5 'Ignore this
      Set var_64 = serie.Text5
      var_C8 = var_64
      var_eax = serie.Text5 'Ignore this
      Set var_5C = serie.Text5
      var_48 = Text5.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_5C, var_00417640, 160)
      End If
      var_6C = var_4C
      var_7C = 1
      var_84 = 2
      var_4C = 0
      var_74 = 8
      var_94 = Mid(var_4C, 6, 1)
      var_50 = CStr(var_94)
      var_54 = CStr(Asc(var_50))
      var_58 = var_48 & var_54
      var_110 = var_48 & var_54
      Text5.Text = var_58
      If var_110 < 0 Then
        var_110 = CheckObj(var_C8, var_00417640, 164)
      End If
      var_58 = ""
      call undef 'Ignore this '__vbaFreeVarList(00000003h, var_74, var_84, var_94, arg_8, arg_8, arg_8)
      var_eax = serie.Text4 'Ignore this
      Set var_5C = serie.Text4
      var_B8 = var_5C
      var_48 = Text4.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_B8, var_00417640, 160)
      End If
      var_6C = var_48
      var_7C = 1
      var_84 = 2
      var_48 = 0
      var_74 = 8
      var_94 = Mid(var_48, 1, 1)
      var_4C = CStr(var_94)
      var_50 = CStr(Asc(var_4C))
      var_44 = Val(var_50)
      var_eax = %fobj
      call undef 'Ignore this '__vbaFreeVarList(00000003h, var_74, var_84, var_94)
      var_eax = serie.Text4 'Ignore this
      Set var_5C = serie.Text4
      var_B8 = var_5C
      var_48 = Text4.Text
      If var_48 < 0 Then
        var_48 = CheckObj(var_B8, var_00417640, 160)
      End If
      var_6C = var_48
      var_7C = 1
      var_84 = 2
      var_48 = 0
      var_74 = 8
      var_94 = Mid(var_48, 6, 1)
      var_4C = CStr(var_94)
      var_50 = CStr(Asc(var_4C))
      var_34 = Val(var_50)
      var_eax = %fobj
      call undef 'Ignore this '__vbaFreeVarList(00000003h, var_74, var_84, var_94)
      var_9C = &H418408
      var_A4 = 8
      var_74 = var_44 & &H418408
      var_84 = var_74 & var_34
      var_48 = CStr(var_84)
      var_24 = Val(var_48)
      call undef 'Ignore this '__vbaFreeVarList(00000002h, var_74, var_84)
      var_eax = serie.Text5 'Ignore this
      Set var_60 = serie.Text5
      var_eax = serie.Text5 'Ignore this
      Set var_5C = serie.Text5
      var_48 = Text5.Text
      edi = ""
      If var_48 < 0 Then
        var_48 = CheckObj(var_5C, var_00417640, 160)
      End If
      var_6C = var_48
      var_48 = ""
      var_74 = 8
      var_ret_1 = var_48 / var_24
      var_ret_2 = Int(var_ret_1)
      var_4C = CStr(var_ret_2)
      Text5.Text = var_4C
      If var_4C < 0 Then
        var_4C = CheckObj(var_60, var_00417640, 164)
      End If
      call undef 'Ignore this '__vbaFreeVar
      var_4 = ""
      GoTo loc_004D2FFC
      var_54 = "": var_58 = ""
      call undef 'Ignore this '__vbaFreeVarList(00000003, var_74, var_84, var_94, var_004D3012)
      Exit Sub
      loc_004D2FFC: 
      call undef 'Ignore this '__vbaFreeVar
      call undef 'Ignore this '__vbaFreeVar
      call undef 'Ignore this '__vbaFreeVar
    End Sub
    EN VOUS REMERCIANT,
      0  0

  2. #2
    Modérateur
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 077
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 077
    Points : 17 180
    Points
    17 180
    Par défaut
    Salut

    Le code n'est pas du VB6 et antérieur, du VB.net ou VBA .... ?
    Si tu peux me donner exactement le langage utilisé, je pourrai déplacer ta demande d'aide pour te permettre d'avoir une réponse adaptée.
    Soyez sympa, pensez -y
    Balises[CODE]...[/CODE]
    Balises[CODE=NomDuLangage]...[/CODE] quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Balises[C]...[/C] code intégré dans une phrase.
    Balises[C=NomDuLangage]...[/C] code intégré dans une phrase quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Le bouton en fin de discussion, quand vous avez obtenu l'aide attendue.
    ......... et pourquoi pas, pour remercier, un pour celui/ceux qui vous ont dépannés.
    👉 → → Ma page perso sur DVP ← ← 👈
      0  0

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2017
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Transports

    Informations forums :
    Inscription : Août 2017
    Messages : 5
    Points : 2
    Points
    2
    Par défaut
    salut

    CE CODE EST DU visual basic.

    *MERCI*
      0  0

  4. #4
    Membre extrêmement actif Avatar de mjpmjp
    Homme Profil pro
    Retraité
    Inscrit en
    Avril 2012
    Messages
    1 133
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hautes Alpes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Santé

    Informations forums :
    Inscription : Avril 2012
    Messages : 1 133
    Points : 1 435
    Points
    1 435
    Par défaut
    bonjour,
    à mon avis , c'est du vba ou vb qui est destiné à une routine du langage assembleur

    @+JP
    Caractéristiques (WEB) phpMyAdmin 4-74 , PHP 5-631 , Apache 2-427 , MySQL 5-719
    Présentation NAS DS-3615xs + 20Go , DSM 6.1.6-15266 Up1 , 12 * WD 4To WD4000F9YZ (10 raid 6+ )+(2 raid 1+) , LinkSys comutateur-switch lgs528p-eu , Onduleur UPS 720W Power Boxx Lcd (4*UPS + 4*MOD)
    Mes contributions (EXCEL) Form GRAPHIQUE: Gestion des boutons , Liste Onglet dynamique...GESTION de FILM
      0  1

  5. #5
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Bonjour
    Ce code ne saurait être ni du VB5, ni du VB6, ni du VBA
    Aucun de ces trois langages n'accepterait (entre autres) ceci :
    puis cela :
    Voilà voilà

    Or, tu ne nous signales aucun message d'erreur (qu'enverrait forcément l'un de ces trois langages) !

    Et tu ne poses comme question que celle-ci : t'expliquer ce code ! Qui ne saurait fonctionner dans l'un quelconque de ces trois langages !
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.
      0  1

  6. #6
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    De prime abord, il serait préférable que ce soit toit qui explique ce que tu attends de ce code!

    On ne demande pas d'explication sur un code dont on ignore la finalité? Non?

    A vue de nez je dirais du Vb6! Toujours à vue de nez ce code n'a rien de compliqué il est juste lisible on pourrait en retirer de 80%!
    Dernière modification par Invité ; 25/02/2018 à 16h14.
      0  1

  7. #7
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Bonjour Robert
    Non. Pas du VB6. VB6 ne laisserait pas passer ce que j'ai montré dans mon message précédent.
    EDIT : je viens de le vérifier et confirme.
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.
      0  1

  8. #8
    Invité
    Invité(e)
    Par défaut
    Bonsoir Jaques,

    C'est justement la tournure du code qui m'a fait dire Vb6,mais je te fais confiance!
    Pour acquis de conscience je ferais un test demain!Mais je pense arriver aux mêmes conclusions que toi mais comme je vieilli...
      0  1

  9. #9
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Tant sous VBA, que sous VB5 ou VB6, il n'est pas possible d'affecter un objet à une variable par une simple égalité. L'utilisation de l'instruction SET est alors indispensable.
    Dans la famille Visual Basic, seul VB.Net permettrait de telles affectations. Mais le code montré serait lui également à jeter à la poubelle, si écrit (et forcément alors sans l'option Strict) pour VB.Net.

    EDIT : après relecture minutieuse et analyse du code montré :
    1) on a manifestement affaire là à un code, originellement écrit dans une autre langage (c++ ou Java ?), puis transformé/adapté pour VBA (très mal et par un "apprenti-sorcier"), notamment pour "désaffecter/désinitialiser" certaines variables
    2) un grand soin a été pris pour nommer les variables de telle manière qu'un examen du fichier en l'ouvrant par le bloc-notes ne faciliterait pas les tentatives d'en déceler les fonctionnalités.

    Ma conclusion (mais je peux me tromper) : des galopins s'échangent des "trucs" dont la finalité n'est probablement pas très "franche"
    Je ne pense pas que l'on reverra le demandeur dans la présente discussion.

    EDIT 2
    Et ces trois lignes successives laissent assez rêveur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    call undef 'Ignore this '__vbaFreeVar
      call undef 'Ignore this '__vbaFreeVar
      call undef 'Ignore this '__vbaFreeVar
    et tendent à confirmer que mon impression n'est pas éloignée de la vérité (bricolage d' "apprentis-sorciers" qui maîtrisent mal -ou pas du tout- la libération -en mémoire- de variables).
    Et une question se pose par ailleurs : quelle est la "nécessité" d'intervenir sans cesse en mémoire pour la vider de certaines variables que l'on recrée ensuite ? Je n'en vois personnellement qu'une : "cacher", autrement dit "gêner" les tentatives d'observation de ce qui se passe
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.
      0  1

  10. #10
    Invité
    Invité(e)
    Par défaut
    Bonjour Jaques,

    c'est bien du Vb6, développé par un unijambiste! avec certainement du on error resume next dans la procédure principale!
    il manque un grande partie du code!

    mais inadaptable en VBA!

    pour ma part, analyser un code pour le plaisir,as le temps! si le posteur précise la finalité, on pourra trempette proposer qq chose!

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    Private Sub Form_Load() Dim var_5C As TextBox
     var_5C = ""
     Set var_5C = serie.Text4
     Call undef 'Ignore this '__vbaFreeVar
    End Sub
    Private Sub undef() 'Décharger Api ou variable de ces API
    End Sub
    http://nsis.sourceforge.net/mediawik...mes&oldid=6257
    Dernière modification par Invité ; 26/02/2018 à 10h17.
      0  1

  11. #11
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Bonjour Robert
    Pas pu accéder à ton lien.
    Regarde ce que m'affiche mon protecteur :
    Summary

    Computer Threats: 2
    Identity Threats: 0
    Annoyance factors: 0

    Total threats on this site: 2

    Threat Report
    small-warning
    Viruses
    Threats found: 2
    Pour y accéder, il me faudrait inhiber ma protection ...
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.
      0  1

  12. #12
    Invité
    Invité(e)
    Par défaut
    How to install the VB6 runtimes

    Revision as of 08:54, 30 June 2005 by 84.175.246.217 (Talk) (Description)

    (diff) ↠Older revision | Latest revision (diff) | Newer revision → (diff)

    Author: sunjammer (talk, contrib)


    Contents




    NSIS 2.01 and later

    NSIS 2.01 has a new library system that makes it easy to install files like the VB6 runtimes. This script and more information is also available in appendix B of the users manual.
    Description

    The correct version of the following files should be stored in your script folder (or modify the paths to the local files if you want to use another folder):

    • msvbvm60.dll
    • oleaut32.dll
    • olepro32.dll
    • comcat.dll
    • asycfilt.dll
    • stdole2.tlb

    A Microsoft article that explains how to obtain these files is available.
    To ask the user for a reboot if required, use the Modern UI with a Finish page or use IfRebootFlag and make your own page or message box.
    The Script

    !include Library.nsh

    Var ALREADY_INSTALLED

    Section "-Install VB6 runtimes"

    ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the
    ;application is already installed. For example:

    IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation
    ;Replace MyApp.exe with your application filename
    StrCpy $ALREADY_INSTALLED 1
    new_installation:

    !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED \
    "msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR"
    !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
    "oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
    !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
    "olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR"
    !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
    "comcat.dll" "$SYSDIR\comcat.dll" "$SYSDIR"
    !insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED \
    "asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR"
    !insertmacro InstallLib TLB $ALREADY_INSTALLED REBOOT_PROTECTED \
    "stdole2.tlb" "$SYSDIR\stdole2.tlb" "$SYSDIR"

    SectionEnd

    Section "-un.Uninstall VB6 runtimes"

    !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll"
    !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll"
    !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll"
    !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll"
    !insertmacro UnInstallLib DLL SHARED NOREMOVE "$SYSDIR\asycfilt.dll"
    !insertmacro UnInstallLib TLB SHARED NOREMOVE "$SYSDIR\stdole2.tlb"

    SectionEndYou can use similar code to install common VB6 ActiveX controls (such as the controls for Windows Common Controls).
    NSIS 2.0 and older

    Still using NSIS 2.0? You can use the UpgradeDLL macro and a few function to install and uninstall the VB6 runtimes. Note that the NSIS 2.01 system above is recommended and provides a better and more stable installation method.
    Description

    The best way to install the VB6 runtimes using NSIS 2.0 is to use the UpgradeDLL macro to upgrade the DLL files and the AddSharedDLL function macro when installing the software for the first time to increment the shared DLL count.
    During the uninstallation, use the un.DecrementSharedDLL function below to decrement the shared DLL count (never remove the files, because the shared DLL count is not reliable enough for such imporant files).
    The correct version of the following files should be stored in your script folder (or modify the paths to the local files if you want to use another folder):

    • msvbvm60.dll
    • oleaut32.dll
    • olepro32.dll
    • oleaut32.dll
    • comcat.dll
    • asycfilt.dll
    • stdole2.tlb

    A Microsoft article that explains how to obtain these files is available.
    To ask the user for a reboot if required, use the Modern UI with a Finish page or use IfRebootFlag and make your own page or message box.
    The Script

    !include "UpgradeDLL.nsh"

    Section "-Install VB6 runtimes"

    !insertmacro UpgradeDLL comcat.dll $SYSDIR\Comcat.dll $SYSDIR
    !insertmacro UpgradeDLL msvbvm60.dll $SYSDIR\Msvbvm60.dll $SYSDIR
    !insertmacro UpgradeDLL oleaut32.dll $SYSDIR\Oleaut32.dll $SYSDIR
    !insertmacro UpgradeDLL olepro32.dll $SYSDIR\Olepro32.dll $SYSDIR

    !define UPGRADEDLL_NOREGISTER
    !insertmacro UpgradeDLL asycfilt.dll $SYSDIR\asycfilt.dll $SYSDIR
    !insertmacro UpgradeDLL stdole2.tlb $SYSDIR\stdole2.tlb $SYSDIR
    !undef UPGRADEDLL_NOREGISTER

    ;Only increase DLL count on new installation
    ;Replace MyApp.exe with your application filename
    ;(or use another detection method)

    IfFileExists $INSTDIR\MyApp.exe skipAddSharedDLL
    Push $SYSDIR\asycfilt.dll
    Call AddSharedDLL
    Push $SYSDIR\comcat.dll
    Call AddSharedDLL
    Push $SYSDIR\msvbvm60.dll
    Call AddSharedDLL
    Push $SYSDIR\oleaut32.dll
    Call AddSharedDLL
    Push $SYSDIR\olepro32.dll
    Call AddSharedDLL
    Push $SYSDIR\stdole2.tlb
    Call AddSharedDLL
    skipAddSharedDLL:

    SectionEnd

    Section "-un.Uninstall VB6 runtimes"

    Push $SYSDIR\asycfilt.dll
    Call un.DecrementSharedDLL
    Push $SYSDIR\comcat.dll
    Call un.DecrementSharedDLL
    Push $SYSDIR\msvbvm60.dll
    Call un.DecrementSharedDLL
    Push $SYSDIR\oleaut32.dll
    Call un.DecrementSharedDLL
    Push $SYSDIR\olepro32.dll
    Call un.DecrementSharedDLL
    Push $SYSDIR\stdole2.tlb
    Call un.DecrementSharedDLL

    SectionEnd

    Function AddSharedDLL
    Exch $R1
    Push $R0
    ReadRegDword $R0 HKLM \
    Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
    IntOp $R0 $R0 + 1
    WriteRegDWORD HKLM \
    Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
    Pop $R0
    Pop $R1
    FunctionEnd

    Function un.DecrementSharedDLL
    Exch $R1
    Push $R0
    ReadRegDword $R0 HKLM \
    Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
    StrCmp $R0 "" done
    IntOp $R0 $R0 - 1
    IntCmp $R0 0 rk rk uk
    rk:
    DeleteRegValue HKLM \
    Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
    Goto done
    uk:
    WriteRegDWORD HKLM \
    Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
    Goto done
    done:
    Pop $R0
    Pop $R1
    FunctionEnd
      0  1

  13. #13
    Membre extrêmement actif
    Homme Profil pro
    aucune
    Inscrit en
    Avril 2016
    Messages
    7 563
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 82
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Avril 2016
    Messages : 7 563
    Points : 12 422
    Points
    12 422
    Par défaut
    Pas mieux, ce lien --->>
    Ceci est une page web dangereuse connue.Il est fortement recommandé de ne PAS visiter cette page.
    Mais la lecture de ces deux lignes SUCCESSIVES de code que tu montres me laisse sans mot :
    Je n'accepte pas de demande d' "amitié" individuelle. Tout développeur est pour moi un ami.
    Je n'ouvre AUCUN classeur tiers (avec ou sans macro ******). Ne m'en proposez donc pas .

    ****** : Non, non ... un classeur .xlsx ne "peut" par exemple et entre autres pas contenir un activex (de surcroît invisible) , "bien sûr" ...

    Il est illusoire de penser que l'on saurait exprimer valablement et précisément en un langage (rigide) de développement ce que l'on peine à exprimer dans le langage naturel, bien plus souple.
      0  1

  14. #14
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par unparia Voir le message
    Pas mieux, ce lien --->>

    Mais la lecture de ces deux lignes SUCCESSIVES de code que tu montres me laisse sans mot :

    oui pas mieux également!

    de toutes les façon ça na rien à voir avec Vba et analyser le code du poste #1 ne rime à rien! j'imagine qu'il devrait avoir une petit idée de ce qu'il veux faire d'une manière générale! à moins que le hasard lui est fait trouvé un code qui parressait joli!
      0  1

  15. #15
    Expert éminent sénior
    Avatar de Marc-L
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2013
    Messages
    9 468
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2013
    Messages : 9 468
    Points : 18 677
    Points
    18 677
    Par défaut
    Salut !

    Depuis le début mon avis est que cela sent le Fake Code de l'ordre d'une chance sur deux,
    du genre code fourni pour se débarrasser d'un inopportun ne voulant pas travailler par lui-même …

    Tu ne comprends pas le code ?   Ben c'est simple, demander des explications à sa source !

    Un peu comme « J'ai trouvé un code sur le Net mais il correspond pas à mon besoin, vous pouvez le modifier ? »
    Ben non, autant tout jeter à la poubelle et enfin réfléchir au besoin afin d'en présenter une analyse digne de ce nom !

    ___________________________________________________________________________________________________________
    Je suis Paris, Egypte, Nigeria, New-York, Mogadicio, Barcelone, London, Manchester, Stockholm, Istanbul, Berlin, Nice, Bruxelles, Charlie, …
    C'est parce que la vitesse de la lumière est plus rapide que celle du son que tant de gens paressent brillants avant d'avoir l'air con ! (Thomas Boishardy)
      1  1

Discussions similaires

  1. petite explication svp
    Par vmfa-2 sven dans le forum C++
    Réponses: 4
    Dernier message: 20/05/2008, 17h06
  2. [ASP:Login] Besoin d'explication SVP.
    Par ketthos dans le forum ASP.NET
    Réponses: 1
    Dernier message: 22/07/2007, 11h46
  3. gestion de double clic , des explications svp
    Par pas30 dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 13/07/2007, 15h25

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