Solved

Visual Basic 6.0 Project will not "Make"

Posted on 2010-11-30
14
658 Views
Last Modified: 2012-05-10
I have a solution in VB6 that has multiple projects as part of the whole. I need to build one .exe from one of the projects for an update. The issue is, when I click on the 'Make *.exe', I get a Compiler Error: Sub or Function not defined. I know all my variables and functions are defined because I have had to build this .exe in the past. I get the feeling it is a referencing issue, but I can't see where to make the change. Each code page has the Option Explicit set at the top. Any help at all would be greatly appreciated. Attached is a screenshot of the VB screen before I try to Make. The utility is set as the startup project, and all the projects are checked out of Source Safe. Screenshot of VB screen before Make.
0
Comment
Question by:Abacus IT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 3
  • +1
14 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 34238858
have you check your reference into each project to see if you have some references marked as (missing) ?
0
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 125 total points
ID: 34238915
Let's assume you've made a mistake and actually accidently deleted a function:  Will the individual VBP files compile?  Will the application run in the IDE (if so, you might find the "missing" function that way.

If you didn't delete the function, I can tell you from experience that VB sort of losses its mind with some very large projects.  What I'm about to tell you is going to sound silly, but in years past, I've run into unexplained complier issues myself and this has fixed it.  The rearrange the source code.

If you know which project is "crashing", then open the VBP for that project in notepad and rearange the order of the files.  If you know which object (class or form) that is "crashing", rearrainge the order of the functions within the file.  YES, I have actually fixed a problem LIKE what you describe by simply shuffling the order of the functions in the original source code.
0
 
LVL 1

Author Comment

by:Abacus IT
ID: 34239344
@ emorau, I did check the refereneces, and sadly, none are missing. That would be too easy.

@ HooKooDooku, I will try that and see if that makes any difference. It does seem a strange way to fix it, but if it's worked in the past, it should work now. I will let you know what I find.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Author Comment

by:Abacus IT
ID: 34239403
HooKooDooku, attached is the Function that is "creashing". The actual line that it is failing on is the:

Case "Export": Call ExportData(ssdbInfo)

I tried re-arranging the whole Sub in notepad, but that did not change the outcome of the build. Any other suggestions?
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
   ' fraSearch.Visible = False
    Select Case Button.Caption
        Case "Find":   If Not Toolbar1.Buttons.Item(5).Enabled Then Call GetManufacturerInformation
        Case "Stop":   blnCancel = True
        Case "Undo":   ssdbInfo.Columns("Status").Value = "Changed"
        Case "Delete": Call DeleteRow
        Case "Save":   Call SaveData
                       Call GetManufacturerInformation
                       Call EnableSwitch(True)
        Case "Copy":   Call CopyData
        Case "Export": Call ExportData(ssdbInfo)
     '   Case "Cancel": Call CancelFunction
        Case "Close":  Unload Me
                       
    End Select
End Sub

Open in new window

0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 34244836
So the first obvious question is where is "ExportData" defined?  Are you sure it is in scope.  Prove it by temporaroly commenting out the source code for ExportData() and redefine a subroutine with the same name within the form code that this crashing function is located in.
0
 
LVL 1

Author Comment

by:Abacus IT
ID: 34248212
The functions are defined. I believe I am having a referencing problem, because when I closed and re-opened the solution this morning and tried to Make the .exe, I got an error on a different form then I had yesterday. I will look into what reference I could possibly be missing. Again, I did check the References dialog box, and none are marked as Missing.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 34248567
can you run from IDE?
it will tell you what line will cause the problem
0
 
LVL 1

Author Comment

by:Abacus IT
ID: 34248784
The utility project runs fine from the IDE. The part that fails is when I attempt to close a form in the utility, then it takes me to that same function stating Sub or Funtion not defined, pointing to that same Call to ExportData.
0
 
LVL 26

Assisted Solution

by:EDDYKT
EDDYKT earned 125 total points
ID: 34248810
if you lightlight the ExportData and right click and go to definition
Does it point to correct function?
0
 
LVL 1

Author Comment

by:Abacus IT
ID: 34248855
I get an error stating Identifier under cursor is not recognized.
0
 
LVL 26

Assisted Solution

by:EDDYKT
EDDYKT earned 125 total points
ID: 34249285
which mean you cannot find exportdata on your current project
Does exportdata on another project you need to communicate with?

Try to press F2 and type exportdata and see where it find the exportdata function
0
 
LVL 16

Assisted Solution

by:HooKooDooKu
HooKooDooKu earned 125 total points
ID: 34250492
So actually, the application "fails" in the IDE (i.e. this isn't just a complier problem).  The ExportData function/sub simply isn't in scope within the form/class that you displayed above.  

Can you show the source code for "ExportData" and explain where it is relative to the code you've already posted?
0
 
LVL 1

Author Comment

by:Abacus IT
ID: 34250845
I will do that as soon as I'm able to. Things just got busy here.
0
 
LVL 1

Author Comment

by:Abacus IT
ID: 34261637
I've narrowed down the problem to an old 3rd party software that was not copied over from an old directory to the new development environment. Now the trick is to get it to install on a new updated system since the old one is, well, so old.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question