Sampels using "Implements" in VB6
From: hawkon (hawkon_at_discussions.microsoft.com)
Date: 07/13/04
- Previous message: hawkon: "Samples using "Implements" in vb6"
- In reply to: hawkon: "Using interface in Visual Basic"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 12:52:07 -0700
Okey, so if no one knows the answer here I wounder if
anybody has any samples I could look at using implements
in VB 6.0.
I'm creating a vb activex dll that I want to call from
Active Server Pages, but I don't have the right syntax in my code
to make it work.
Please help me!
Kind regards,
Jon Haakon
--
------------------------------
Jon Haakon Ariansen
System Consultant
"hawkon" wrote:
> Hi,
>
> I've been reading in MSDN about using Interfaces with Visual Basic (oop similar programming). I have created a vb project based on a sample I found.
>
> I have made one class with definitions (IDog) :
>
> ' IDog expresses behavior of a dog object
> Public Property Get Name() As String
> End Property
>
> Public Property Let Name(ByVal Value As String)
> End Property
>
> Public Sub Bark()
> End Sub
>
> Public Sub RollOver(ByVal Rolls As Integer)
> End Sub
>
> Public Function MyTest()
> End Function
>
> On properties for this class I have put Instancing = PublicNotCreatable.
>
> I have made another class with code for this functions. Goes like this :
>
> Option Explicit
> Implements IDog
>
> Private Name As String
>
> Private Property Let IDog_Name(ByVal Value As String)
> Name = Value
> End Property
>
> Private Property Get IDog_Name() As String
> IDog_Name = Name & "_test"
> End Property
>
> Private Sub IDog_Bark()
> ' implementation
> End Sub
>
> Private Sub IDog_RollOver(ByVal Rolls As Integer)
> ' implementation
> End Sub
>
> Private Function IDog_Mytest()
> IDog_Mytest = "Testing this..."
> End Function
>
> And finally a asp file calling the dll :
>
> set objTestCom = Server.CreateObject("MyServer.IDog")
>
> Response.Write objTestCom.MyTest()
>
>
> objTestCom.Name = "JHA"
>
>
> a = objTestCom.Name
>
> response.write a
>
> Response.End
>
> In Visual Interdev everything seems to work since a popup box with mehods appears on the instance of the dll object. But the only thing I get is an error saying :
>
> Cannot launch out of process component
>
> /testweb/Default.asp, line 18 (Server.Createobject line)
>
> Only InProc server components should be used. If you want to use LocalServer components, you must set the AspAllowOutOfProcComponents metabase setting. Please consult the help file for important considerations.
>
> To correct this I've tried to insert :
>
> <%
> Set WebServObj = GetObject("IIS://LocalHost/W3svc")
> WebServObj.Put "AspAllowOutOfProcComponents", True
> WebServObj.SetInfo
> %>
>
> But then I get that access denied on the first line with the GetObject.
>
>
>
>
> So therefore I'd like to know know what I have to do to make vb components with interfaces work in ASP applications.
>
>
>
> In advance thanks a great deal for your help!!
>
> Kind regards,
>
> Jon Haakon
>
>
>
> --
> ------------------------------
> Jon Haakon Ariansen
> System Consultant
- Previous message: hawkon: "Samples using "Implements" in vb6"
- In reply to: hawkon: "Using interface in Visual Basic"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|