2017-06-28 1 views
3

J'ai récemment téléchargé VB6 pour ouvrir un fichier .VBP que je suis en train de convertir en VB2010. Mon but est d'exécuter le programme sur VB6 afin que je puisse parcourir le code ligne par ligne afin de déboguer le programme que j'écris de zéro dans VB2010.Onglets VB6 ne s'affichent pas sur le formulaire

Le programme, qui fonctionne sur une machine virtuelle, a une forme de starup qui ressemble à ceci:

Form on virtual machine

Cependant, quand je considère le formulaire de démarrage sur VB6, je vois ceci: Form on VB6

Comme vous pouvez le voir, les pages à onglet sont manquantes. Lorsque j'exécute le code, le débogueur interrompt à la première ligne qui implique les pages à onglet (FrontWeights, etc sont tous les noms de quelques pages (noms de GRIDS, pas de pages à onglet), et le débogueur interrompt " FrontWeights.ColWidth (1) = 4280 + 1000"):

Private Sub Form_Load() 
    Screen.MousePointer = 11 

    Width = 10680 
    Height = 6816 
    FrontWeights.ColWidth(1) = 4280 + 1000 
    FrontWeights.ColWidth(2) = 1109 
    FrontWeights.ColWidth(3) = 1109 
    FrontWeights.ColWidth(4) = 1109 
    For I = 1 To 100 
    FrontWeights.AddItem Str$(I), I 
    Next I 
    FrontWeights.Row = 0 
    FrontWeights.Col = 1 
    FrontWeights.Text = "Description" 
    FrontWeights.Col = 2 
    FrontWeights.Text = "Quantity" 
    FrontWeights.Col = 3 
    FrontWeights.Text = "Weight (lbs)" 
    FrontWeights.Col = 4 
    FrontWeights.Text = "Offset (in)" 

    BogieWeights.ColWidth(1) = 4280 + 1000 
    BogieWeights.ColWidth(2) = 1109 
    BogieWeights.ColWidth(3) = 1109 
    BogieWeights.ColWidth(4) = 1109 
    For I = 1 To 100 
    BogieWeights.AddItem Str$(I), I 
    Next I 
    BogieWeights.Row = 0 
    BogieWeights.Col = 1 
    BogieWeights.Text = "Description" 
    BogieWeights.Col = 2 
    BogieWeights.Text = "Quantity" 
    BogieWeights.Col = 3 
    BogieWeights.Text = "Weight (lbs)" 
    BogieWeights.Col = 4 
    BogieWeights.Text = "Offset (in)" 

    CenterWeights.ColWidth(1) = 4280 + 1000 
    CenterWeights.ColWidth(2) = 1109 
    CenterWeights.ColWidth(3) = 1109 
    CenterWeights.ColWidth(4) = 1109 
    For I = 1 To 100 
    CenterWeights.AddItem Str$(I), I 
    Next I 
    CenterWeights.Row = 0 
    CenterWeights.Col = 1 
    CenterWeights.Text = "Description" 
    CenterWeights.Col = 2 
    CenterWeights.Text = "Quantity" 
    CenterWeights.Col = 3 
    CenterWeights.Text = "Weight (lbs)" 
    CenterWeights.Col = 4 
    CenterWeights.Text = "Offset (in)" 

    InternalPipingGrid.ColWidth(1) = 3005 
    InternalPipingGrid.ColWidth(2) = 795 
    InternalPipingGrid.ColWidth(3) = 795 
    InternalPipingGrid.ColWidth(4) = 795 
    InternalPipingGrid.ColWidth(5) = 795 
    InternalPipingGrid.ColWidth(6) = 795 
    InternalPipingGrid.ColWidth(7) = 795 
    InternalPipingGrid.ColWidth(8) = 795 
    For I = 1 To 100 
    InternalPipingGrid.AddItem Str$(I), I 
    Next I 
    InternalPipingGrid.Row = 0 
    InternalPipingGrid.Col = 1 
    InternalPipingGrid.Text = "Description" 
    InternalPipingGrid.Col = 2 
    InternalPipingGrid.Text = "Lbs/Ft" 
    InternalPipingGrid.Col = 3 
    InternalPipingGrid.Text = "Gal/Ft" 
    InternalPipingGrid.Col = 4 
    InternalPipingGrid.Text = "Passes" 
    InternalPipingGrid.Col = 5 
    InternalPipingGrid.Text = "X Front" 
    InternalPipingGrid.Col = 6 
    InternalPipingGrid.Text = "Y Front" 
    InternalPipingGrid.Col = 7 
    InternalPipingGrid.Text = "X Rear" 
    InternalPipingGrid.Col = 8 
    InternalPipingGrid.Text = "Y Rear" 

    KingPinWeights.ColWidth(1) = 4280 + 1000 
    KingPinWeights.ColWidth(2) = 1109 
    KingPinWeights.ColWidth(3) = 1109 
    KingPinWeights.ColWidth(4) = 1109 
    For I = 1 To 100 
    KingPinWeights.AddItem Str$(I), I 
    Next I 
    KingPinWeights.Row = 0 
    KingPinWeights.Col = 1 
    KingPinWeights.Text = "Description" 
    KingPinWeights.Col = 2 
    KingPinWeights.Text = "Quantity" 
    KingPinWeights.Col = 3 
    KingPinWeights.Text = "Weight (lbs)" 
    KingPinWeights.Col = 4 
    KingPinWeights.Text = "Offset (in)" 

    LandingLegWeights.ColWidth(1) = 4280 + 1000 
    LandingLegWeights.ColWidth(2) = 1109 
    LandingLegWeights.ColWidth(3) = 1109 
    LandingLegWeights.ColWidth(4) = 1109 
    For I = 1 To 100 
    LandingLegWeights.AddItem Str$(I), I 
    Next I 
    LandingLegWeights.Row = 0 
    LandingLegWeights.Col = 1 
    LandingLegWeights.Text = "Description" 
    LandingLegWeights.Col = 2 
    LandingLegWeights.Text = "Quantity" 
    LandingLegWeights.Col = 3 
    LandingLegWeights.Text = "Weight (lbs)" 
    LandingLegWeights.Col = 4 
    LandingLegWeights.Text = "Offset (in)" 

    RearWeights.ColWidth(1) = 4280 + 1000 
    RearWeights.ColWidth(2) = 1109 
    RearWeights.ColWidth(3) = 1109 
    RearWeights.ColWidth(4) = 1109 
    For I = 1 To 100 
    RearWeights.AddItem Str$(I), I 
    Next I 
    RearWeights.Row = 0 
    RearWeights.Col = 1 
    RearWeights.Text = "Description" 
    RearWeights.Col = 2 
    RearWeights.Text = "Quantity" 
    RearWeights.Col = 3 
    RearWeights.Text = "Weight (lbs)" 
    RearWeights.Col = 4 
    RearWeights.Text = "Offset (in)" 

    Screen.MousePointer = 0 
End Sub 

Toute aide sur la façon dont je peux résoudre ce problème? FYI - c'est un projet de travail, donc je serais hésitant à partager/télécharger des fichiers.

EDIT: texte du fichier projet:

Type=Exe 
Module=MODULE11; TransWgt.Bas 
Form=TankSize.frm 
Form=Properti.frm 
Form=Bulkhead.frm 
Form=PrintOut.frm 
Form=Drawing.frm 
Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0; COMCTL32.OCX 
Object={00028C01-0000-0000-0000-000000000046}#1.0#0; DBGRID32.OCX 
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\SysWOW64\stdole2.tlb#Standard OLE Types 
Reference=*\G{00025E01-0000-0000-C000-000000000046}#4.0#0#C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\DAO350.DLL#Microsoft DAO 3.0 Object Library 
Form=InputData.Frm 
Startup="InputDataForm" 
HelpFile="" 
Title="Transport Weight Analysis" 
ExeName32="TransWgt.Exe" 
Command32="" 
Name="TransportWeightAnalysis" 
HelpContextID="0" 
CompatibleMode="0" 
MajorVer=1 
MinorVer=0 
RevisionVer=0 
AutoIncrementVer=0 
ServerSupportFiles=0 
VersionComments="This is a pre-release version of this program." 
VersionCompanyName="E.D. Etnyre & Co." 
VersionFileDescription="Program for calculating weight distributions of any transport." 
CompilationType=0 
OptimizationType=0 
FavorPentiumPro(tm)=0 
CodeViewDebugInfo=0 
NoAliasing=0 
BoundsCheck=0 
OverflowCheck=0 
FlPointCheck=0 
FDIVCheck=0 
UnroundedFP=0 
StartMode=0 
Unattended=0 
Retained=0 
ThreadPerObject=0 
MaxNumberOfThreads=1 

EDIT 2: changé de forme VM à ce que l'écran affiche ensemble (c.-à-un menu)

EDIT 3: Il y avait un fichier .CLS que VB6 n'était pas en mesure de charger initialement. J'ai ajouté manuellement non. Maintenant, quand je cours, mon erreur indique «Erreur de compilateur: procédure extérieure invalide»

+1

Les billes dans ma tête pense que n'est pas le contrôle standard TabStrip fourni avec VB6. On dirait un produit de tiers. Le code que vous avez posté semble remplir une grille. – LarsTech

+0

Affiche le contenu du fichier VBP. –

+0

Le texte est ajouté. En outre, j'ai été en mesure d'utiliser l'Assistant de mise à niveau VB2008 pour mettre à niveau le fichier .VBP VB6. Il y a une tonne d'erreurs de syntaxe, mais le contrôle de tabulation n'est pas présent, si cela aide –

Répondre

1

Personne d'autre que vous ne peut dire ce qui s'est passé, mais - juste deviner - la référence aux SSTabs contenus dans le TABCTL32.OCX a été supprimée (ou remplacé par une référence au mscomctl.ocx, à cause du TabStrip ...?) et le projet a été sauvegardé

Au moins, je peux vous dire pourquoi vous ne voyez pas d'autre contrôle sur le formulaire autre que ceux du premier onglet:

Ci-dessous vous voyez un formulaire avec trois onglets, chacun commande à l'intérieur:

enter image description here

la façon dont SSTabs fonctionne, est en déplaçant les commandes vers la gauche en dehors de la forme pour le cacher:

 Text1.Left = 480   Text2.Left = -74520   Text3.Left = -74520 

Ouvrez le fichier .frm avec le Bloc-notes, les commandes sont là, mais vous pouvez juste » Je le vois dans l'IDE.

A la fin, en fonction à quel point votre projet, je crois que vous avez deux options:

  • Restauration par la main dans le .frm les SSTabs puis dans l'IDE, placez les commandes sur un autre conteneur
  • changement à la main dans le fichier .frm la position des commandes en déplaçant les coords gauche par 75000

Comme n'est pas clair pour moi quelle version VB6-vous exactement installé, je suis d'ajouter ci-dessous pour votre une commodité compléter le fichier .frm. où vous pouvez voir la structure stockée des SSTabs. Ajoutez les onglets dont vous avez besoin.

VERSION 5.00 
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" 
Begin VB.Form Form1 
    Caption   = "Form1" 
    ClientHeight = 2835 
    ClientLeft  = 60 
    ClientTop  = 345 
    ClientWidth  = 3615 
    LinkTopic  = "Form1" 
    ScaleHeight  = 2835 
    ScaleWidth  = 3615 
    StartUpPosition = 3 'Windows Default 
    Begin TabDlg.SSTab SSTab1 
     Height   = 2535 
     Left   = 120 
     TabIndex  = 0 
     Top    = 120 
     Width   = 3285 
     _ExtentX  = 5794 
     _ExtentY  = 4471 
     _Version  = 393216 
     TabHeight  = 520 
     TabCaption(0) = "Tab 0" 
     TabPicture(0) = "FormTabs.frx":0000 
     Tab(0).ControlEnabled= -1 'True 
     Tab(0).Control(0)= "Text1" 
     Tab(0).Control(0).Enabled= 0 'False 
     Tab(0).ControlCount= 1 
     TabCaption(1) = "Tab 1" 
     TabPicture(1) = "FormTabs.frx":001C 
     Tab(1).ControlEnabled= 0 'False 
     Tab(1).Control(0)= "Text2" 
     Tab(1).Control(0).Enabled= 0 'False 
     Tab(1).ControlCount= 1 
     TabCaption(2) = "Tab 2" 
     TabPicture(2) = "FormTabs.frx":0038 
     Tab(2).ControlEnabled= 0 'False 
     Tab(2).Control(0)= "Text3" 
     Tab(2).Control(0).Enabled= 0 'False 
     Tab(2).ControlCount= 1 
     Begin VB.TextBox Text3 
     Height   = 375 
     Left   = -74520 
     TabIndex  = 3 
     Text   = "Text3" 
     Top    = 1680 
     Width   = 2295 
     End 
     Begin VB.TextBox Text2 
     Height   = 375 
     Left   = -74520 
     TabIndex  = 2 
     Text   = "Text2" 
     Top    = 1080 
     Width   = 2295 
     End 
     Begin VB.TextBox Text1 
     Height   = 375 
     Left   = 480 
     TabIndex  = 1 
     Text   = "Text1" 
     Top    = 720 
     Width   = 2295 
     End 
    End 
End 
Attribute VB_Name = "Form1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 

End Sub 

La même référence est ajouté au fichier .vbp, au sommet, à proximité des autres:

Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX 
+0

Je vais essayer ça! –

+0

donc, j'ai recherché "onglet" dans le dossier le fichier .VBP se trouve dans et trouvé le fichier suivant: TABCTL32.OCX. C'était dans un dossier intitulé "SetupWiz" –

+0

J'ai VB6 Express –