Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save Form as Class Question 1

Status
Not open for further replies.

ggrewe

IS-IT--Management
Jul 10, 2001
169
US
I have a form that I recently converted to a class (Save As). I modified all the code to use createobject instead of do form. But when I build the exe, the form keeps being added back into the project manager. When I rename the form, the complier generates an error trying to find the form, but the EXE seems to run just fine without it. Is there a reason for this? Can I safely delete this form and keep modifying the class? Is there a way to prevent the compiler from adding the form back into the project manager? Thanks in advance.
 
Do you have a Do Form blabla somewhere in your project?



Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
Nope, I modified all the code to use createobject instead of do form. Here is the error in the program.err file:

Visual Class Library ..\taxprogramclasses.vcx has the following errors:
Form REPORTS - Undefined

taxprogramclasses.vcx is the name of the class that contains the new class "reportsmenu". Reports is the name of the form that I saved as a class.
 
If the form keeps getting added back into the project, then something is still calling the form the old way. Go ahead and delete the SCX/SCT from the old form. The next time you build your project, it will complain at the point that's still using DO FORM. Then you'll know what to fix.


-BP (Barbara Peisch)
 
Thanks Barbara, I did that and the post above yours shows the response from the compiler. It is the class itself that is trying to call the old form.
 
When you saved the form as a class, did you change its name? If so, you can search for the old name, and find out exactly where in taxprogramclasses.vcx the old report is being called. If you have VFP 8, use the Code References tool to search. Otherwise, use Steve Dingle's PJXSearch tool, which is a free download from

-BP (Barbara Peisch)
 
Thanks Barbara, that is a cool tool! It found a reference in a class that I was no longer using and had forgotten to remove from the project. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top