Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 29/12/2006, à 23:47

Jaydbois

Wine et les applications VB

Bonjour à tous,

Je suis débutant en Linux et j'ai découvert depuis ces dernières semaines les foultitudes de possibilités offertes par Ubuntu.

Je travaille en équipe sur un projet bénévole et nous cherchons aujourd'hui à porter nos applications VB vers un environnement Linux (en l'occurence Ubuntu 6.06 LTS Dapper Drake) suite à une migration d'un hébergement gratuit vers un hébergement de type dédibox de chez Free.

Il faut donc assurer le fonctionnement du serveur malgré cette contrainte. A cette fin, on a recours à Wine qui, s'il n'est pas un émulateur, nous rend des services du même genre.

Or, notre serveur s'appuie sur la création d'objets VB qui sont définis dans des DLLs externes, notamment des objets ado et msxml. Il se trouve que ces créations renvoient invariablement des erreurs 429.

La question est donc de trouver un moyen de faire fonctionner la création desdits objets via une fonction de test, dont le code suit. Cette fonction ne fait que simuler la création d'objet, je reste ouvert à toute proposition plus judicieuse.

VERSION 5.00
Begin VB.Form Form1 
   Caption        =   "Test d'instanciations d'objets"
   ClientHeight  =   3135
   ClientLeft     =   60
   ClientTop      =   345
   ClientWidth    =   4275
   LinkTopic       =   "Form1"
   ScaleHeight     =   3135
   ScaleWidth      =   4275
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command5 
      Caption         =   "collection"
      Height          =   270
      Left            =   0
      TabIndex        =   7
      Top             =   1560
      Width           =   4215
   End
   Begin VB.CommandButton Command6 
      Caption         =   "instancier"
      Height          =   300
      Left            =   2775
      TabIndex        =   5
      Top             =   2850
      Width           =   1380
   End
   Begin VB.TextBox Text1 
      Height          =   300
      Left            =   0
      TabIndex        =   4
      Text            =   "- nom objet -"
      Top             =   2520
      Width           =   4215
   End
   Begin VB.CommandButton Command4 
      Caption         =   "ADODB.Connection"
      Height          =   255
      Left            =   0
      TabIndex        =   3
      Top             =   1200
      Width           =   4215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "scripting.dictionary"
      Height          =   285
      Left            =   0
      TabIndex        =   2
      Top             =   840
      Width           =   4215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "MSXML2.ServerXMLHTTP"
      Height          =   255
      Left            =   0
      TabIndex        =   1
      Top             =   480
      Width           =   4215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "scripting.filesystemobject"
      Height          =   270
      Left            =   0
      TabIndex        =   0
      Top             =   120
      Width           =   4215
   End
   Begin VB.Line Line1 
      X1              =   15
      X2              =   4215
      Y1              =   2040
      Y2              =   2040
   End
   Begin VB.Label Label1 
      Caption         =   "instanciation générique"
      Height          =   285
      Left            =   15
      TabIndex        =   6
      Top             =   2235
      Width           =   4155
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    testco Command1.Caption
End Sub
Private Sub Command2_Click()
    testco Command2.Caption
End Sub
Private Sub Command3_Click()
    testco Command3.Caption
End Sub
Private Sub Command4_Click()
    testco Command4.Caption
End Sub
Private Sub Command5_Click()
    On Error Resume Next
    Err.Clear
    Dim test
    Set test = New Collection
    If Err.Number <> 0 Then
        MsgBox "createObject 'collection' raté !! \nerreur " & Err.Number & " : " & Err.Description
    Else
        MsgBox "CreateObject 'collection' réussi"
    End If

    Set test = Nothing
End Sub

Private Sub Command6_Click()
 testco Text1.Text
 
End Sub

Sub testco(ByVal nom_obj As String)
    On Error Resume Next
    Err.Clear
    Set test = CreateObject(nom_obj)
    If Err.Number <> 0 Then
        MsgBox "createObject '" & nom_obj & "' raté !! \nerreur " & Err.Number & " : " & Err.Description
    Else
        MsgBox "CreateObject '" & nom_obj & "' réussi"
    End If

    Set test = Nothing
End Sub

Je paie une pinte à l'ubuntien qui me sort de cette panade. smile

Hors ligne