CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: class modules

  1. #1
    Guest

    class modules

    I want to know how to use the implements statement.

    Actually what i did was i created a class module A and also created another class module B different activexexe projects
    In B i declared a procedure public sub SAVED()
    end sub
    In A 's general declaration i wrote IMPLEMENTS B
    and i declared procedure private sub saved() end sub

    In the form I created a Obj of B and then
    Set OBj = new a
    ANd i said a.saved.
    But iam getting error
    Highlighting the IMplement statement in A
    Object Module needs to implemnt saved for interface B


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: class modules

    You need to implement all the interfaces from B into A

    Open up the class module for A and click on the left hand combo in the code window - you should see 'B' - make sure that you have a procedure defined for each property/methog that B exposes, *EVEN IF THEY ARE EMPTY*

    eg


    Implements B
    '
    private Sub B_Saved()
    ' nothing In Here
    End Sub




    The procedure is marked as Private as it can't be accessed through an object of type A - only of type B



    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured