p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_components thread: Ask COM+


Message #1 by quang pham <phambaquang@y...> on Thu, 20 Jun 2002 18:43:59 -0700 (PDT)
Dear Sir/Madam

Please give an answer to me about something of COM+.
I have an application on Visual Basic and base on COM
technology. And now I want to convert my application
to base on COM+. The following is what I have done:
1 - Add reference "COM+ Services Type Library" to the
COM project.
2 - In General Declarations code, I type:
	Option Explicit
	public x as String
	Implements ObjectControl
	
3 - Implement following 3 Subs and Function:
	Private Sub ObjectControl_Activate()
	    x = "ObjectControl_Activate"
	End Sub

	Private Function ObjectControl_CanBePooled() As
Boolean
	    ObjectControl_CanBePooled = False
	End Function

	Private Sub ObjectControl_Deactivate()
	    x = "ObjectControl_Deactivate"
	End Sub
	
	Public function Show_x() as String
	    Show_x = x
	End Sub
4 - I save this project with project name is Prj_com
and class name is Cls_com. After that I  make .dll
file, everything is OK.
5 - Use Components Sevices tools to install this COM.
6 - Create an .ASP file with following code:
	<%	
           Set myObj = Server.CreateObject("Prj_com
.Cls_com")
	   Response myObj.Show_x	
	%>
7 - Create a Vitual directory on IIS Web server to run
this .ASP file.
8 - Run this .ASP file on web browser and I see
nothing is appear.

As me know, in this project I used ObjectContext, so
when I call any method in this COM, then the message
of "ObjectControl_Activate" will be call first, but I
did not see that. Please give me a lead how to create
the COM+ project.

Best regards,

Quang Pham

A engineer of HOBO International Corporation - Ha Noi
- Viet Nam.
Email: PhamBaQuang@y...

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

  Return to Index