Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ado and VFP6.0 SP5
Message
 
 
To
21/07/2003 18:57:18
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00812173
Message ID:
00813794
Views:
7
Hi Dante,

I'm not sure exactly what the problem is so I'm guessing that the error in your class isn't intercepted by ON ERROR in the class. In this case you should use ERROR method of your COM class. It's also better to return Null as indication of failer and store error message in to a property of the class.
DEFINE CLASS Prueba  AS Custom OLEPUBLIC
	Suma = 0
        ErrorMessage = ""
	PROCEDURE Error
		This.Suma = Null
                This.ErrorMessage = "Error en el Traspaso de alguna variable"
	ENDPROC
	
	Procedure Suma
	parameters valor1,valor2,valor3
	This.Suma = valor1+valor2+valor3
	return This.Suma
	ENDPROC
Enddefine
You can also post your question in VFP forum Spanish edition.

>Hello friends of the forum are developing a Dll in VFP6.0Sp5 but not you that
>to make that when the Dll throws an error this he/she informs the user the error
>that happened as this way:
>
>Ejplo Dll
>DEFINE CLASS Prueba AS Custom OLEPUBLIC
> Procedure Suma
> parameters valor1,valor2,valor3
> On Error xerror=.t.
> suma=valor1+valor2+valor3
> If xerror <--- Si Ocurrio el Error enviar un mensaje al Usuario
> return "Error en el Traspaso de alguna variable" <- Un Ejmplo
>cualquiera
> Else
> return suma
> Endif
>Enddefine
>
>
>In my Button of my form that he/she calls to the Dll
>oPrueba=Createobject (" Prueba.prueba ")
>Xsuma=oPrueba.suma(1,1,A) <--- I send him variable TO as character so that me
>throw the Error
>
>I arrive until here one doesn't eat to show the Error that my Dll sends sum since
>it can return numeric as the message of Error it can return, when
>I activate the On Error in my Form I hurtle Error in Ole Custom....... but not
>it throws me the personalized message that I want somebody he/she can tell me as giving solution to
>This.
>
>He/she notices:
>As it could manage the transactions in an environment multiuser by means of Ado
>
>Thank you for the whole help that you/they can offer me
>
>
>Dante Castillo Z.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform