Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 1733
Message
From
04/06/2019 02:29:39
 
 
To
03/06/2019 16:10:20
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
01668856
Message ID:
01668891
Views:
64
I can see your point, but I never use set classlib, because I use a lot of factory patterns where the classnames are the same, but from different libraries. For instance there is a difference if you instantiate cook from France.vcx or cook from Italy.vcx.

Now I could change the classnames into cook_france and cook-italy and put those into the same classlib like cooks, but where would I then put my spaghetti class without bothering the french cook. Also if the actual menu does not serve any italian dishes why would I bother loading the italian libraries in the first place.

I follow these rules now for a long time, and with a project of close to 7000 classlibs it turned out to be a life saver.

But don't get me wrong, in other projects there are probably other strategies more helpful.

>Hugo,
>Sorry I am not with you on this one.
>Let me explain once more what the situation is:
>I have a classlib with multiple classes. Amongst with there are classes 'cntMySelection', 'cntPictures', 'cntReceiver' all members of classlib 'MyClasses.vcx'
>I have a file 'setClassLIb.prg' which loads all my classlibs ness for the pjx.
>In a form I can instantiate the different classes by either drag and drop them on a form or instantiate them with
>lo=newobject('cntSelection1', 'cntMySelection')
>lo.Top = 10
>etc
>wortks fine and good.
>Now I had this class 'cntPictures' and just and only for this class it errored with error 1733.
>Than I found, that in my contatiner cntPictures which has several objects, textboxes a grid a.s.o. one of the objects had an error, if fact a text box called a cursor.field which was not available.
>When I than changed the code for newobject wit 3 parameters into newobject('cntPicture1', 'cntPicture','myCLasses.vcx') the container was instantiated as such and errored on the text box. Correcting the textbox and called newobject without the 3rd parameter, all wen well.
>This 3rd parameter is not listed in the Help file of NEWOBJECT() function
>Sorry but setclasslib is very usefull and to my opinion advisable. I cant see any cons not to set classlib.
>Regards,
>Koen
>
>>Here I go again against the grain... I think it is a mistake to use "set classlib"; and the whole purpose of newobject vs createobject is to handle this, in my opinion.
>>So, you either use newobject (method or function) without "set classlib" (my preferred way, in fact the only way I use it) or you use createobject (function) with "set classlib" (I only use createobject for activex, even when I know I could use newobject for it too), but there is no point in using newobject with "set classlib". I know from past discussions that there is some consensus here that I am wrong and "set classlib" is useful, but I am also stubborn :)
>>
>>>Hi,
>>>
>>>I am facing error :
>>>"Classdefinition fs_frmmaintenance is not found"
>>>The code line causing this:
>>>This.Newobject("fs_Maintenance1","fs_frmMaintenance")
>>>The class is in the classlib which is set with set Classlib to and most curious is that a few lines above you will find:
>>>
>>>This.Newobject("fs_Actions1", "fs_Actions")
>>>which executes normaly
>>>Both fs_Actions and fs_frmMaintenance are in the same Classlib
>>>
>>>help file is not very helpfull in this respect, besides it states
>>>" The class definition specified in a CREATEOBJECT( ) function cannot be located. " which is wrong as this is a Newobject and not createobject
>>>
>>>I am puzzled.
>>>
>>>Any advise is welcome
>>>
>>>Koen
Christian Isberner
Software Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform