Solved

Visual Basic 6.0 Project will not "Make"

Posted on 2010-11-30
14
645 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
  • 7
  • 3
  • 3
  • +1
14 Comments
 
LVL 69

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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now