Conversion code 16 bit en 32 bit?

Résolu
Stryge69 Messages postés 2 Date d'inscription lundi 5 février 2007 Statut Membre Dernière intervention 14 juin 2010 - 9 juin 2010 à 20:09
Stryge69 Messages postés 2 Date d'inscription lundi 5 février 2007 Statut Membre Dernière intervention 14 juin 2010 - 14 juin 2010 à 17:17
Bonjour,
J'ai le code source d'un programme qui a été fait avec VB3 16 bit, et je souhaite le faire fonctionner sous un enviroment Windows 64 bits...
Est-ce possible de convertir le code en 32 bits?
Quelle est la meilleure marche à suivre?
Y'en a t'il qui ont déjà experimenté cela?
J'ai lu pas mal de choses, comme par exemple PortTool, qui passe en revue le code et propose l'équivalent 32 bit, avez vous deja essayé?
Merci

2 réponses

cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
9 juin 2010 à 23:16
Transformer le code VB3 en VB6.
Poste-le ici si tu as du mal à effectuer cette conversion.

VB.NET is good ... VB6 is better
Utilise Réponse acceptée quand un post répond à ta question
3
Stryge69 Messages postés 2 Date d'inscription lundi 5 février 2007 Statut Membre Dernière intervention 14 juin 2010
14 juin 2010 à 17:17
Voici par exemple (le code est assez long, j'ai juste mis un morceau):

Public Sub Ouvrir_Fiche()

On Error GoTo Errhandler1

Dim Db As Database, Td As TableDefs, Fld As Fields
Dim f_trans As Table
Dim f_ident As Table
Dim f_div As Table
Dim f_employe As Table
Dim f_prov As Table
Dim f_unit As Table
Dim f_exptype As Table
Dim f_endr As Table
Dim reponse As Integer, pdep As Integer
Dim Mois As String, destf1 As String, destf2 As String, sourcf As String
Dim cie_counter As Integer, save_counter As Integer, ndef_cie As Integer
Dim def_cie As String
Dim s_no_empl As Long, s_no_serv As Long, s_no_div As Long, s_no_exptype As Long, s_no_endr As Long
Dim nlength As Integer

destf1 = File_progdir & "\cf_mod20.mdb"
destf2 = File_progdir & "\cf_mod20.ldb"

nlength = Len(FEx_path)

If Mid(FEx_path, nlength, 1) = "" Then
Set Db = OpenDatabase(FEx_path + FEx_file)
Else
Set Db = OpenDatabase(FEx_path + "" + FEx_file)
End If

Set f_ident = Db.OpenTable("cf_ident")
f_ident.Close
Set f_trans = Db.OpenTable("cf_trans")
f_trans.Close

reponse = 1

If reponse = 1 Then

Call Clear_grid
Call Form_init

Screen.MousePointer = HOURGLASS

If Mid(FEx_path, nlength, 1) = "" Then
Set Db = OpenDatabase(FEx_path + FEx_file)
Frm_Cfr.Caption = "Fast Expense - " + FEx_path + FEx_file
Save_cap = "Fast Expense - " + FEx_path + FEx_file
Save_file = FEx_path + FEx_file
Else
Set Db = OpenDatabase(FEx_path + "" + FEx_file)
Frm_Cfr.Caption = "Fast Expense - " + FEx_path + "" + FEx_file
Save_cap = "Fast Expense - " + FEx_path + "" + FEx_file
Save_file = FEx_path + "" + FEx_file
End If

Set f_ident = Db.OpenTable("cf_ident")
s_no_empl = f_ident("f_no_empl")
s_no_serv = f_ident("f_no_serv")
s_no_div = f_ident("f_no_cie")
Txt_rpt_date1.Text = f_ident("f_date1")
Txt_rpt_date2.Text = f_ident("f_date2")
Txt_rpt_annee_f.Text = Format(f_ident("f_annee"), "0000")
Txt_rpt_per_f.Text = Format(f_ident("f_periode"), "00")
'Txt_Objet.Text = f_ident("f_objet")
If f_ident("f_mode_remb") = "1" Then
Opt_cheque = True
Opt_depot = False
Else
Opt_cheque = False
Opt_depot = True
End If
Txt_benef_chq.Text = "" & f_ident("f_benef")
f_ident.Close

Set Db = OpenDatabase(File_progdir & "\patsetup.mdb")

' Load employee name into Comb_nom
Set f_employe = Db.OpenTable("Employe")
f_employe.Index = "EMPKEY"
f_employe.Seek "=", s_no_empl
If f_employe.NoMatch Then
Comb_nom.ListIndex = -1
Else
Comb_nom.Text = "(" + CStr(f_employe("empl_no")) + ") " + f_employe("empl_l_name") + ", " + f_employe("empl_f_name")
End If
f_employe.Close

' Load employee department into Comb_srv
Set f_unit = Db.OpenTable("unit")
f_unit.Index = "UNITKEY"
f_unit.Seek "=", s_no_serv
If f_unit.NoMatch Then
Comb_srv.ListIndex = -1
Else
If ls = 1 Then
Comb_srv.Text = "(" + CStr(f_unit("unit_no")) + ") " + f_unit("unit_name_f")
ElseIf ls = 2 Then
Comb_srv.Text = "(" + CStr(f_unit("unit_no")) + ") " + f_unit("unit_name_e")
End If
End If
f_unit.Close

' Load employee division into Comb_div
Set f_div = Db.OpenTable("Division")
f_div.Index = "DIVKEY"
f_div.Seek "=", s_no_div
If f_div.NoMatch Then
Comb_div.ListIndex = -1
Else
If ls = 1 Then
Comb_div.Text = "(" + CStr(f_div("div_no")) + ") " + f_div("div_nom_f")
ElseIf ls = 2 Then
Comb_div.Text = "(" + CStr(f_div("div_no")) + ") " + f_div("div_nom_a")
End If
End If
f_div.Close

If Mid(FEx_path, nlength, 1) = "" Then
Set Db = OpenDatabase(FEx_path + FEx_file)
Else
Set Db = OpenDatabase(FEx_path + "" + FEx_file)
End If
Set f_trans = Db.OpenTable("cf_trans")
f_trans.Index = "TRANSKEY"
If f_trans.RecordCount <> 0 Then
f_trans.MoveFirst
Lignes = 0
Km_Cum_Nouv = Km_Cum
Do While f_trans.EOF = False
s_no_exptype = f_trans("f_code_frais")
s_no_endr = f_trans("f_code_endr")
Lignes = Lignes + 1
grd_dtl.Row = Lignes
grd_dtl.Col = 0
grd_dtl.Text = Lignes
grd_dtl.Col = 1
grd_dtl.Text = f_trans("f_no_doc")
grd_dtl.Col = 2
grd_dtl.Text = f_trans("f_date_trns")
grd_dtl.Col = 4
grd_dtl.Text = "" & f_trans("f_expl")
grd_dtl.Col = 5
grd_dtl.Text = CStr(f_trans("f_tot"))
grd_dtl.Text = Format$(grd_dtl.Text, "#,##0.00 ")
grd_dtl.Col = 6
grd_dtl.Text = CStr(f_trans("f_net"))
grd_dtl.Text = Format$(grd_dtl.Text, "#,##0.00 ")
grd_dtl.Col = 7
grd_dtl.Text = CStr(f_trans("f_tps_payee"))
grd_dtl.Text = Format$(grd_dtl.Text, "#,##0.00 ")
grd_dtl.Col = 8
grd_dtl.Text = CStr(f_trans("f_tvq_payee"))
grd_dtl.Text = Format$(grd_dtl.Text, "#,##0.00 ")
grd_dtl.Col = 10
grd_dtl.Text = f_trans("f_f_net")
grd_dtl.Col = 11
grd_dtl.Text = f_trans("f_f_tot")
grd_dtl.Col = 12
grd_dtl.Text = f_trans("f_netklm")
Km_Cum_Nouv = Km_Cum_Nouv + f_trans("f_netklm")
grd_dtl.Col = 13
grd_dtl.Text = CStr(f_trans("f_cr_fed") + 0)
grd_dtl.Text = Format$(grd_dtl.Text, "#,##0.00 ")
grd_dtl.Col = 14
grd_dtl.Text = CStr(f_trans("f_cr_prov") + 0)
grd_dtl.Text = Format$(grd_dtl.Text, "#,##0.00 ")
grd_dtl.Col = 15
grd_dtl.Text = "" & f_trans("f_compte")
grd_dtl.Col = 16
0
Rejoignez-nous