Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COMRETURNERROR Not Working
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00998944
Message ID:
00998971
Views:
37
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
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform