Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object or NoObject?
Message
De
30/07/2013 11:58:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01579421
Message ID:
01579437
Vues:
48
>>Hi,
>>
>>I have following coding:
>>
>>
>>DO case
>>case myCondition
>>Otherwise
>>
>>loObj    = Sys( 1270 )
>>        
>>        If Vartype( m.loObj ) # "O"
>>            Return
>>        Endif
>>        
>>        lcClass  = m.loObj.Class
>>endcase
>>
>>Which errors on line lcClass = m.loOj.CLass with error 1426
>>In Debugger vartype(m.loObje) = "O"
>>
>>Any idea what kind of mistake in this coding?
>>
>>Regards,
>>
>>Koen
>
>It seems that the object it returns is an OLE object which does not expose the "Class" property.
>Can you see in the debugger if you just type m.loObj what this object is (or m.loObj.Name)?
>
>You might want to try:
>
>DO case
>        case myCondition
>Otherwise
>
>loObj    = Sys( 1270 )
>        
>        If TYPE( "m.loObj.Class" ) # "C"
>            Return
>        Endif
>        
>        TRY
>                lcClass  = m.loObj.Class
>        CATCH TO loError
>                Messagebox(loError.Message)
>                lcClass = NULL
>        ENDTRY
>
>endcase
>
>
Hi,
TYPE( "loObj.Class" ) # "C"
seems to work!

FWIW: TYPE( "loObj.Class" )= "U"

and errorhandler gives indeed: OLE error code 0x80020006: Onbekende naam. (unknown name)

Thanks,

Regards,

Koen
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform