Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COMRETURNERROR Problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01064666
Message ID:
01064704
Views:
30
I think it doesn't work because the object isn't instantiated yet until Init is finished. Try some other method.

>I can't seem to get COMRETURNERROR to work.
>
>First, my class's ERROR code:
>
>
>PROTECTED PROCEDURE Error(iError, sMethod, iLine)
>		
>  LOCAL sSource, sMessage
>		
>  WITH This
>
>    ** Form the error strings
>    sSource = TRANSFORM(iError) + CHR(13)+;
>            sMethod+;
>	    TRANSFORM(iLine)
>
>    sMessage = "Error"
>
>    ** Populate the COM exception structure
>    =COMRETURNERROR(sSource, sMessage)
>	
>   ENDWITH
>		
>ENDPROC
>
>
>Next, in the INIT I placed:
>
>
>PROCEDURE Init
>		
>  LOCAL sString
>		
>  sString = "Kevin"
>
>  ** This will trigger the Error method
>  ? DTOC(sString)
>	
>ENDPROC
>
>
>And when I compile the DLL and instantiate the class, I get
>"OLE error code 0x80004005: Unspecified error."
>
>Shouldn't it be displaying my error string?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform