Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 1733
Message
From
29/05/2019 13:04:19
 
 
To
29/05/2019 12:44:34
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
01668856
Message ID:
01668858
Views:
60
>>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
>
>Newobject() (both method and function) require that the 2nd parameter be the class library, and the extension for it is, by default, .prg - because it was, IIRC, made to accommodate the prg based classes. Try with adding .vcx to the name. .NewObject() may or may not care about set("classlib"), I'm not sure.

Dragan,
I have a long procedure with following:
.Newobject("fs_Maintenance1", "fs_frmmaintenance" )
		With .fs_Maintenance1
			.Top = m.lnTop
			.Left = m.lnMargin
			.Visible = .T.
		Endwith

		.Newobject("fs_Header1", "fs_Header")
		With .fs_Header1
			.Top = lnMargin
			.Left = .fs_Calendar1.Width + (lnMargin * 2)
			.Width = .Width - .fs_Calendar1.Width - (lnMargin * 2)
			.Anchor = 10
			.Visible = .T.
		Endwith
Both fs_frmmaintenance and fs_Header are classes in the same classlib (vcx) file.
fs_frmMaintenance errors and fs_Header1 not and is created.
NewObject, to my opion requires newobject(cObjectName, cClassname) and not the cClassLibraryName, VFP will look in the loaded classlibraries (VCX) files for the Class = 2ndParameter.

Regards,

Koen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform