Interface problem please help. am stuck

Results 1 to 2 of 2

Thread: Interface problem please help. am stuck

  1. #1
    Join Date
    Dec 1969

    Default Interface problem please help. am stuck

    Hi I have created an object model that I plan to use in an ecommerce site. <BR><BR>I have one object named visit and another named catalog. <BR><BR>I have implemented an Interface on the visit object. <BR><BR>The interface is in a module named ModuleEshop. Everything works fine to there. <BR><BR>Want I now want to do is pass this interface to my catalog object. I have created the follwoing Subroutine on the catalog obect . <BR><BR>------------------------------------------------------------------- <BR>Public Sub Config(ByVal IsiteHelper as IsiteHelper) <BR><BR>mIsitehelper = IsiteHelper <BR><BR>End Sub <BR>------------------------------------------------------------------- <BR><BR>The Isitehelper type is underlined and I am getting this message. <BR><BR>"&#039;Isitehelper&#039; Cannot expose a friend type outside of the Public Class Catalog" <BR><BR>What could be causing this message??? Am I doing something wrong. Below is the code for my visit & catalog classes. <BR><BR>visit.vb <BR>---------------------------------------------------- <BR><BR>Imports Shop.ModuleEshop <BR><BR>Public Class Visit <BR>Implements ISitehelper <BR><BR>Private mSitename As String = ConfigurationSettings.AppSettings("Sitename") <BR>Private mOwner As String = ConfigurationSettings.AppSettings("Owner") <BR>Private mConnstr As String = ConfigurationSettings.AppSettings("connstr") <BR><BR>Private mdatabase As database <BR>Private mcatalog As Catalog <BR><BR>Public ReadOnly Property Visit() As Visit Implements ISitehelper.Visit <BR>Get <BR>Visit = Me <BR>Return Visit <BR>End Get <BR>End Property <BR><BR>Public ReadOnly Property database() As database Implements ISitehelper.Database <BR>Get <BR>If mdatabase Is Nothing Then <BR>mdatabase = New Database <BR>mdatabase.Configure(mConnstr) <BR><BR>database = mdatabase <BR>Return database <BR>End If <BR>End Get <BR>End Property <BR><BR>Public ReadOnly Property Catalog() As Catalog <BR>Get <BR>If mcatalog Is Nothing Then <BR>mcatalog = New Catalog <BR>mcatalog.config(Me) <BR>Catalog = mcatalog <BR>Return Catalog <BR><BR>End If <BR>End Get <BR>End Property <BR>End Class <BR>------------------------------------------------------------------------------------- <BR><BR>Catalog.vb <BR><BR>------------------------------------------------------------------------------------- <BR>Imports Shop.ModuleEshop <BR><BR>Public Class Catalog <BR><BR>Private mIsitehelper As ISitehelper <BR><BR>Public Sub Config(ByVal ISiteHelper As ISitehelper) <BR><BR>mIsitehelper = ISiteHelper <BR><BR>End Sub <BR>End Class <BR><BR>-----------------------------------------------------------------<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Interface problem please help. am stuck

    Did you declare your interface as Public? Doesn&#039;t sound like it. You probably just defined it as:<BR><BR>Interface IsiteHelper <BR>...<BR>End Interface<BR><BR>If so, add Public before Interface.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts