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

Threaded View

  1. #1
    Join Date
    Nov 2006
    Posts
    99

    Resolved [SOLVED]another embarsassing ?

    i have a user control

    defined an interface on it
    Code:
      public interface IMain
            {
                [DispId(1)]
                int addsomething(int val1,int val2)
            }
    
    public class Main : IMain
            {
                public Main() { }
                public int addsomething(int val1,int val2)
                {
                    return(val1 + val2)
                }
    
    }
    the conntrol builds.

    now i place the control on my form/page. how do i get to the interfaces???
    i know this is really simple but need to ask...as this is one of the rare times i work on wb controls...or windows controls...

    [Resolution]
    1. compiled my user control. it is called myusercontrol.dll
    2. created new windows application in c#
    3. loaded myusercontrol and its instance is called testingmyusercontrol
    4. declared the following
    public myusercontrol.usercotrol.IMain interfaceTest;

    5. button on click event:
    set interfacetest = new myusercontrol.usercontrol.main();
    int result = interfacetest.addsomething(1,1)


    BlackLazy: where would the 'code' button be? yea i now know that one can use the tags
    Last edited by jss3426; February 19th, 2007 at 08:56 PM. Reason: [SOLVED]

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