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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot comile application due to inability to locate control within a

Status
Not open for further replies.

tomandsandy

Programmer
Sep 19, 2001
24
0
0
US
I am trying generate a build of an application I inherited. The only thing holding me up is "Error Instantiating Class". Cannot find edtpcbound in pcfwctrl.vcx" . I then hit locate and find both the control and class. This message keep popping up relentlessly and I cannot satisfy the request and thus cannot properly build the project so I can test and run. I do not know the version of FoxPro this project was initially created in but I am using FoxPro 9 to test and debug.

Tom
 
You wouldn't normally see "Error Instantiating Class" during a build unless it's a class used inside a project hook. You might look there to see what's going on.
 
Yes, I agree with Dan. There's usually no reason for the build process to try to instantiate a class.

I suggest you start by searching your application for all references to the class name (use Code References for that). Let us know if you find any.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Forgive me, in the process of trying to build the application I ran into several errors. I am down to one error on a form. The application will not allow me to open the form due to the calss instantiation exception. The frustration lise in the fact that i do a locate on the class and point to the control allowing the application see what it needs but the rror keep coming up no matter how many times I locate the file and control.

I used to do a lot of Visual Foxpro programming. The problem is the last time I did was back in the year 2000. SO I am a little rusty when it comes to locating Code References. It is slowly coming back as I work through the code of the application I inherited.

Thank you for your quick response

Tom
 
So you get this or a similar error and a chance to locate the class when opening the form, right?

That's what is very familiar. Also it's familiar foxpro is forgetting that, but actually you just need to save the class explicitly via CTRL+S, even though vfp does not detect changes, but it actually did change to class location within the form/class data. But only if you savfe that it's permanent.

Do it again, hit CTRL+S, then reopen. If vfp then still doesn't remember what you told, open the vcx as table and manually hack the data. use your.vcx/browse, check the classloc fields of records, that point to wrong related classes/classlibs.

Bye, Olaf.
 
OK, so this has nothing to do with building the app.

Since this is an inherited project, are the files by chance marked read-only? That would keep VFP from properly saving that class' location.
 
The save did not work. I will try hacking the table.

Tom
 
No, not read-only. I initially reset the attributes after copying from the CD.

Tom
 
I went in and hacked the vcx/table by changing the class lib pointer to the correct location. I am still getting "Error Instantiating Class". "Cannot find edtpcbound in pcfwctrl.vcx". pcfwctrl is a subclass of the parent xxfwctrl. I don't know if this has anything to do with it but all pointers are pointing to the correct locations and VF still cannot locate the controls even though I can get into the class (VCX file) and edit each control it cannot find. This makes no sense...

Thank you

Tom
 
It only makes no sense because you haven't found the problem yet. Once you find the problem, it'll make perfect sense. <g>

I'd be tempted to try the old remove & replace trick.

Create a brand new blank form.
Copy the errant control from the app's form to the new blank form.
Remove the errant control from the app's form and save it.
The app's form should now open cleanly.
If yes, then paste the control back onto the app's form and save.

Dan
 
Has anyone ever heard of Visual MaxFrame. This application uses the Visual MaxFrame professional framework.

Tom
 
Sorry Dan just frustrated. I will try to addthe controls to an empty form. I do not know what the original form looks like since I have not been able to open it period. I do know which controls it uses by the error messages. I will try that.

Thanks

Tom
 
I thought you had opened the form after locating the missing controls. Sorry.

Being a Maxframe app is an important detail. I know that some of the frameworks (and I have a vague memory this applies to Maxframe) require you to be "in" their environment when working with their controls.

is MaxFrame's home, and I believe they have a support forum there.
 
dan said: I thought you had opened the form after locating the missing controls.

I also thought so, because only after successfully locating and specifying the classes, saving that version helps.

You could have a cascading problem, if the missed classes themselves are based on classes. It really looks like you didn't get the whole project including the maxframe framework. Maybe a license issue?

In a bad case the framework is not located on the same drive as the original project location was, then you get absolute paths within classloc instead of the usual relative paths. You also didn't shift vcx files into a new folder structure, did you? That makes everything go out of whack of course.

This short code will tell you what's not matching the supposed classlib locations:

Code:
For Each loFile in _vfp.ActiveProject.Files
   If loFile.Type = "V"
      Use (loFile.name) Alias classlib
      Scan for !Empty(classloc)
         lcClasslibFile = Rtrim(FullPath(AddBS(JustPath(Dbf()))+classlib.classloc))
         If !File(lcClasslibFile)
            ? "location of", Rtrim(classlib.class), "supposed in", lcClasslibFile, "not found."
         Endif
      Endscan
   EndIf
EndFor

Bye, Olaf.
 
Dave and Olaf,

This makes total sense. I did not shift VCX files into a new folder structure but the folder structure I was given was not the original folder structure the application was compiled in. I made a copy of everything and attempted to move the files to their absolute paths. I tried this before reaching out to Tek-Tips. I will contact the original owner and see if I can get the original (production version) tree structure of the application.

Thank You

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top