Erreur d'éxécution

nicolasbonnet13 Messages postés 6 Date d'inscription jeudi 28 juillet 2005 Statut Membre Dernière intervention 16 mai 2008 - 16 mai 2008 à 11:12
NHenry Messages postés 15113 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 22 avril 2024 - 19 mai 2008 à 08:54
Bonjour,

J'ai conçu une petite application en visual Basic qui permet à plusieurs personnes d'uploader des fichiers sur un serveur ftp.

Tout marche bien sur mon poste vista mais sur un poste xp, quand je clique sur le bouton "Parcourir" pour aller sélectionner le fichier j'obtiens cette erreur.Quelqu'un peut t'il m'aider svp ?

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: Cannot create ActiveX component.
  at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)
  at WindowsApplication1.Module1.OuvrirAvecCD(String Extension, String DOSSIER, String TITRE)
  at WindowsApplication1.F_Bienvenue.B_Parcourir_Click(Object sender, EventArgs e)
  at System.Windows.Forms.Control.OnClick(EventArgs e)
  at System.Windows.Forms.Button.OnClick(EventArgs e)
  at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
  at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ButtonBase.WndProc(Message& m)
  at System.Windows.Forms.Button.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
TéVé Velaux
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Utilisateur/Bureau/T%E9V%E9_Velaux.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

3 réponses

Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 74
16 mai 2008 à 11:19
quel est le code de OuvrirAvecCD
0
nicolasbonnet13 Messages postés 6 Date d'inscription jeudi 28 juillet 2005 Statut Membre Dernière intervention 16 mai 2008
16 mai 2008 à 18:06
Merci de ta réponse voila mon code:




Public








Function

OuvrirAvecCD(


ByVal

Extension


As





String

,


ByVal

DOSSIER


As





String

,


ByVal

TITRE


As





String

)



Dim

cdFichierS‚lectionn‚ =



""


CD = CreateObject(





"MSComDlg.CommonDialog"

)



On





Error





Resume





Next


Debut:








With

CD.MaxFileSize = 260

.InitDir = DOSSIER

.CancelError =



True


.DialogTitle = TITRE


.Filter =





"Fichiers "

& Extension &


"(*."

& Extension &


")|*."

& Extension &


"|"


.FilterIndex = 1


Err.Clear()


.ShowOpen()








If

Err.Number <> 0


Then








If

MsgBox(


"Vous n'avez pas s‚lectionn‚ de fichier."

& Chr(10) &


"Voulez-vous annuler la s‚lection ?"

, vbYesNo, TITRE) = vbYes


Then








Exit





Function








Else








GoTo

Debut



End





If








End





If








End





With


FichierS‚lectionn‚ = cd.FileName


CD =





Nothing








End





Function
0
NHenry Messages postés 15113 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 22 avril 2024 159
19 mai 2008 à 08:54
Bonjour

Je ne capte plus. Tu es en VB6 ou .NET ?

Dim cd
Non typée, Met "Option Explicit" (VB6 &VB.NET)et "Option Strict" à ON (VB6.NET only)

CD = CreateObject("MSComDlg.CommonDialog" )
Pas besoin de cela, tout est déjà dans .NET, il y a déjà un controle .NET (section "Boites de dialogue" de la barre d'outils).

On Error Resume Next
    Err.Clear()
    If Err.Number <> 0 Then
Error en VB.NET !!!, si tu code en .NET, utilises Les Try/Catch avec les exceptions.

    .ShowOpen()
Là tu utilises du VB6, si tu es en .NET, il y a déjà un controle .NET (section "Boites de dialogue" de la barre d'outils).

        GoTo Debut
HORREUR, un GOTO en .NET. Je te conseil plutot une boucle Do/Loop infinie dont tu sort (Exit Do) si tout est OK.

FichierSélectionné = ""
Evite les accents dans le noms de variables, fonction, ...

Voilà pour ces quelques lignes.

Le fer à souder a besoin d'une panne pour fonctionner.
VB (6, .NET1&2), C++, C#.Net1
Mon site
0
Rejoignez-nous