Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class Definition is not found
Message
From
08/01/2012 03:12:57
 
 
To
07/01/2012 14:11:10
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01532347
Message ID:
01532409
Views:
81
>>>>I have a Class Library common_libs.vcx
>>>>
>>>>Looking at it in the Class Browser there is a class cntPartno
>>>>
>>>>within cntPartno are several subclasses (cntAvl, cntExcess, cntMRB, etc.)
>>>>
>>>>I want to create a new subclass cntDMR which will be a duplicate of cntMRB.
>>>>
>>>>I Created a new ClassLib (clsTemp.vcx)
>>>>
>>>>I opened two instances of the class browser. In the first one I opened common_libs. In the second I opened clsTemp.
>>>>
>>>>In the first class browser I clicked on cntMRB. I then CTRL-Clicked on the icon just to the left of the drop-down at the top of the screen and dragged it into the second class browser. I now have cntMRB showing in both class browsers.
>>>>
>>>>I renamed the class in the second browser and CTRL-Click dragged it back to the first. The renamed class shows up in the first browser where I expect (underneath cntPartno)
>>>>
>>>>I then modified cntMRB by putting a MESSAGEBOX statement so that I could tell I was working with the correct library.
>>>>
>>>>Everything works fine in my test environment within VFP.
>>>>
>>>>However, when I compile the APP file and install it into my production environment I get a "Class Definition cntDMR is not found" message. Invoking cntMRB shows the new MESSAGEBOX.
>>>>
>>>>Have I done anything wrong in the way I created this new class?
>>>
>>>
>>>I would do this as follows:
>>>Click on File ->New (in the VFP menu)
>>>Select the option Class en click on button New file
>>>You will be selected with a window “New Class”
>>>In first textbox you give cntDMR for Class Name
>>>Your click on the … button in the “Based on” line.
>>>This will open a getfile() prompt which will be restricted to Class Library.
>>>Now find and locate your class library common_libs.vcx when you have selected that, there will be listed, in the right panel. a list of all the classes in this selected library. Select in this case the class cntMRB
>>>Click on open button in the getfile prompt and you will be returned to the window “New Class”
>>>Now you can either store your cntDMR class in the common_libs.vcx or select an other or new class by clicking on the … button in the Store in line.
>>>When done you can start making additional modifications to your just newly created cmdDMR class. Open the library etc . etc.
>>>
>>>Regards,
>>>Koen
>>>>
>>
>>
>>Thanks for the response.
>>
>>1. Does this make it a copy or a sub-class of cntMRB? If a sub-class I will try this using cntPartno for the "Based On."
>>
>>2. I think I tried an equivalent of this from the command window
>>CREATE CLASS cntDMR OF common_libs AS cntPartno FROM common_libs
>>and wound up with the same error.
>>
>>Thanks again. I'll post the results on Monday
>>
>>......Rich
>>
>Hi,
>Yes your newly created class cntDMR is an exact copy of the class which it is based on. Even if you make afterwards any changes to your based on class, cntDMR will inherit them.


Which, if I understand correctly, is not an exact equivalent of what I did originally. My intent was to create a clone/copy of the first class (cntMRB), not to create a sub-class.



>Your line
>
>CREATE CLASS cntDMR OF common_libs AS cntPartno FROM common_libs
>will error in case common_libs.vcx is not in your path
>

Understood. Were it not in the path I would type in the path to the vcx. But my development environment starts with a config file that sets my path to FORMS;PROGS;REPORTS; etc so anything I want to reference in the command window is always in the path.




>Question: Why do you start 'the hard way' by creating in code? Use Visual FoxPro
>

Why do you consider it the "hard way."?

Using the Command Window rather than the meur bar seems much faster and has the advantage of creating a command history.
I admit I'm a dinosaur, but I'd MUCH rather SET PATH in a config file and type MODI COMM/FORM/FILE/MENU/REPORT than go through the File --> Open --> pick a type --> navigate to the directory --> find my file --> etc. etc. etc.

But all that nit-picking aside, I really could use your advice on how to find out why I'm getting the "Can't find the class" error message. I know it's finding the right version of the VCX library because I've put MESSAGEBOX() lines in some of the other classes and they show up.

I could look at the VCX but in this case I really don't know what to look for.

.......Rich
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform