Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 To: Sithu Kyaw
  Where is Sithu Kyaw?
 Yangon
 Myanmar
 Sithu Kyaw
 Tags
Subject: RE: Error instantiating class
Thread ID: 365148 Message ID: 365257 # Views: 29 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Sunday, December 23, 2012 10:46:05 AM         
   


Maybe you simply forgot to mark "rebuilding all files" when rebuilding your project?. Either that or you have a number of lines in your coding that you manually created references to the class. The latter is what I meant when earlier I said you started using class rather wrongly/unusually. Normally a vcx is simply dropped on a form. VFP will take care of the path reference and inclusion into exe/app automatically.

If what you claim to be a problem is in essence the same as saying that one cannot use a class then remove it and then, somehow out of a real necessity, either:
- use another class from somewhere/anywhere that happens to bear the same name as a removed class, or
- use the same class again but now from another location, edited or not.
That is PLAINLY IMPOSSIBLE with our dearly and outrageously beloved VFP!!!

What actually are you trying to do? Let Rick and I and probably others warn you that no matter what you say no way in this small world ever that we will ever divorce our married-to-death VFP - lol

David
..
.



> Yes, you are right, Rick. But you might not understand my problem.
> I'm just trying to do version control, but I'm not using any version control software. Just doing manually.
> I cannot know what will be changes on my visual class. I has been using the original class (version 1)
> The problem is in the middle of development, I've used 1.0 on My App and I've dropped the controls of 1.0 on my forms.
> Now, I'm not able to fix the class path references to 2.0.
> I could not re-do / re-drop all. It seems to be starting the project again. It is not possible.
>
> Why the class path of a visual class is persistent once any control of it has been dropped on the form?
> This is my point. I'm just looking for a fix to this.

>
> > Here's the problem. You don't need to do what you're doing here. Instead, create a new class which uses as its parent the original class. This allows you to keep the original code and only apply whatever changes you'll need to make to what is then the derived class, for that one application. The parent / base class remains the same with the core functionality. You can use DODEFAULT() on the child to call the original code, and then modify slightly for the needs of your new app. The variations you need which are specific to a later application are then only applied to the derived class, while the base class, the original class, remains the same.
> >
>
> Thank you for your suggestion. You are trying to say inheritance.
> Inheritance can be done in all programming languages which support OOP.
> I would not create any derived class for this issue.
> Implementing inheritance is for parent-child relationship, for example, Animal is parent (original class). Dog or Cat is child (derived class). Thus, I think it is off-topic to my issue.
>
> > Another possibility is to create a copy of the class object and give it another name in the same class file.
>
> Thank you again. It is very closed to my problem, but as I said above, I could not re-do / re-drop all controls of the copy of the new class. I repeat, I'm in the middle of project development and I has been using the previous one(version). I could not roll back all.
>
> > Lots of possibilities to accommodate what you're doing. You just need to learn them.
>
> Yes, I'm learning forever :)
>
> > You should not always try to get things to work the way you think they should work
>
> What I'm trying to do does make sense.
>
> > VFP is very good at resolving and fixing class names.
>
> I don't understand completely what you said. Now, I'm facing the problem of resolving and fixing class names or paths.
>
> The only solution I can think of is that I have to create visual objects at run time so that I can change the class path easily such as
>
> SET CLASSLIB TO (dir\<font color="Blue">to\<font color="Blue">version-x.x\myclass.vcx\)
> 

>
> I'm just looking for a better way?
>
> ----
> Rgds/Sithu

ENTIRE THREAD

Error instantiating class Posted by Sithu Kyaw @ 12/21/2012 4:15:28 PM
RE: Error instantiating class Posted by Rick Hodgin @ 12/21/2012 4:28:01 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/21/2012 4:46:11 PM
RE: Error instantiating class Posted by David Mustakim @ 12/21/2012 4:50:38 PM
RE: Error instantiating class Posted by Rick Hodgin @ 12/21/2012 4:50:41 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/21/2012 4:59:25 PM
RE: Error instantiating class Posted by David Mustakim @ 12/21/2012 5:08:58 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 5:31:59 AM
RE: Error instantiating class Posted by David Mustakim @ 12/22/2012 6:09:59 AM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 7:11:06 AM
RE: Error instantiating class Posted by David Mustakim @ 12/22/2012 7:43:49 AM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 10:40:17 AM
RE: Error instantiating class Posted by Rick Hodgin @ 12/22/2012 5:29:00 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/23/2012 6:30:09 AM
RE: Error instantiating class Posted by David Mustakim @ 12/23/2012 10:46:05 AM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/23/2012 11:37:37 AM
RE: Error instantiating class Posted by Samir H. @ 12/23/2012 1:31:38 PM
RE: Error instantiating class Posted by David Mustakim @ 12/23/2012 6:44:38 PM
RE: Error instantiating class Posted by David Mustakim @ 12/22/2012 6:25:48 AM
RE: Error instantiating class Posted by Tamar Granor @ 12/21/2012 11:01:38 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 5:13:38 AM
RE: Error instantiating class Posted by David Mustakim @ 12/21/2012 4:48:39 PM
RE: Error instantiating class Posted by Stefan Wuebbe @ 12/23/2012 11:02:32 AM