Results 1 to 3 of 3

Thread: Interface Issue

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Interface Issue

    Can someone tell me ?when i tried to compile .why i am getting error ?'ExInterface.Myimages' does not implement interface member 'ExInterface.ipict.DeleteImage()' C:\Documents and Settings\Administrator.IT\Local Settings\Application Data\Temporary Projects\ExInterface\Program.cs.let me know please.
    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace ExInterface
    {
        public interface ipict
           {
            int DeleteImage();
            void DisplayImage();
             }
        public class Myimages : ipict
        {
            public int deleteImage()
            {
                Console.Writeline("DeleteImage Implementation!");
                return (0);
            }
    
    
            public void DisplayImage()
            {
                Console.WriteLine("Display ImageImplementation");
            }
        }
            
       class test
         {
           static void Main()
             {
               Myimages m=new Myimages();
                  m.DisplayImage();
                 int t=m.deleteImage();
           }
       }
    }

  2. #2
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Interface Issue

    C# is case-sensitive. In Interface ipict, you have DeleteImage but in class MyImages, you have deleteImage. Try replacing deleteImage with DeleteImage.
    Show Appreciation. Rate Posts.

  3. #3
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Interface Issue

    another tip:

    when you declare your implementation of the interface in your class, wait a second or so, and you will see the interface decleration being somewhat highlighted at the beginning of the name of the interface. hover over this and then click a button that appears and within here, you can tell Visual Studio to implement the interface members or even explicitly implement the interface members.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

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