Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COMRETURNERROR Not Working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00998944
Message ID:
00999019
Vues:
38
Probably because Calvin created the COMreturnerror function itself in VFP and knows exactly how to use it..
>Claude, I am curious, why the method you posted works but the other don't?
>
>>Here's an example by Calvin Hsia that works everytime:
>>
FUNCTION Error(nError, cMethod, nLine)
>>		COMreturnerror(cMethod+'  err#='+str(nError,5)+'
>>line='+str(nline,6)+' '+message(),_VFP.ServerName)
>>		&& this line is never executed
>>I've used this successfully in both COM mtdlls and COM EXEs ..
>>>I have this in a DLL:
>>>
>>>
>>>PROTECTED PROCEDURE Error(iError AS Integer, sMethod AS String, iLine as Integer)
>>>		
>>>  LOCAL sSource, sDesc
>>>		
>>>  sSource = "Error " + TRANSFORM(iError)
>>>  sDesc	  = MESSAGE() + " in method '" + ALLTRIM(sMethod) + "' on line " + TRANS(iLine)
>>>		
>>>  =COMRETURNERROR(sSource, sDesc)
>>>
>>>
>>>
>>>When an error occurs, the message displayed is:
>>>"OLE Dispatch exception code 0 from ?: ?.."
>>>
>>>Why isn't this working?
>>>
>>>Thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform