Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CREATEOBJECT() failing with no error message?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00188404
Message ID:
00188513
Vues:
24
CreateObject() won't generate an error if it fail, it will return NULL. Make sure that you test that the variable isn't NULL after each CreateObject().

One reason that could explain the problem is that the class return .F. in it Init() event.

HTH

>We have a very large app created in VFP 5.0a (we'll be moving to VFP6 shortly). One of the classes we have designed handles printing of reports, and the way that you use it is to create an instance of it, then set properties and call a method. An example of what this might look like is this:
>
>loPrintGen = CREATEOBJECT("cnPrintGen")
>loPrintGen.GetSettings = .T.
>...
>
>We have several clients who are getting the error "LOPRINTGEN is not an object" on the second line above.
>
>I'm at a loss to explain how that could possibly happen - it's as if the CREATEOBJECT() function was not creating the object for some reason and not reporting any error of its own. And yes, I've double checked the Init and Load methods of the class - they never, ever return false.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform