p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Problem With Using ASP Intrinsic objects in VB component


Message #1 by "Liran Peleg" <pharoah@n...> on Mon, 26 Mar 2001 20:24:05
You need to call the activate event of the ObjectControl interface
e.g.

Public Sub ObjectControl_Activate()

	Dim ObjectContext As COMSVCSLib.ObjectContext
	Dim objResponse As ASPTypeLibrary.Response
	Set ObjectContext = GetObjectContext
	Set objResponse = ObjectContext("Response")
	objResponse.Write "Test"

End Sub

Make sure you are implementing Object Control within your component
e.g.

Implements ObjectControl

Private Function ObjectControl_CanBePooled() As Boolean
'Return true to use object pooling

End Function

Private Sub ObjectControl_Deactivate()
'Deactivation code
	
End Sub

Private Sub ObjectControl_Activate()
'Activation code 

	Dim ObjectContext As COMSVCSLib.ObjectContext
	Dim objResponse As ASPTypeLibrary.Response
	Set ObjectContext = GetObjectContext
	Set objResponse = ObjectContext("Response")
	objResponse.Write "Test"
	
End Sub

Hope this helps
Ian

  Return to Index