Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error being raised With COM+
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00528556
Message ID:
00529899
Views:
10
>Behavior of COM Server Are a bit different in MTS or COM+, They are stateless, meaning as soon as a method is done, is is removed from memory. Maybe there is something wrong with my code but all my tests in COM+ returns the control to the client.
>
>Do you have COM+ ? If no, can you post your test code and i'll try it in COM+.

I'd have to re-read Craig's articles to do it on my end, so here's the code below.

Code for Object A:
Define Class ComError1 As Session OlePublic

	Procedure CallComError2()
		Local loCom2
		loCom2 = CreateObject("ComError2.ComError2")
		loCom2.CauseError()
		Return "after com2 error"	&& never happens
	Endproc

	Procedure Error(nError, cMethod, nLine)

		ComReturnError("Error","ComError1")
		Return "Error occurred"	&& never happens

	Endproc

Enddefine
Code for Object B:
Define Class ComError2 As Session OlePublic

	Procedure CauseError()

		ComReturnError("Error","ComError2")
		Return "After ComReturnError"	&& never happens

	Endproc

Enddefine
I instantiated ComError1 from the command window and executed the CallComError2() method. Very simple code, but hopefully it follows the scenario you described. In my tests, I see "ComError1" in the error message. If control returned directly to the client, I would have expected to see "ComError2" in the error message. If this doesn't match your scenario, let me know what I should change, and I'll try it again.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform