Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

interface function has structure parameter.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andrewcw - 20 Jul 2007 01:22 GMT
I am new to interfaces. My simple string parameter in & return of string
worked fine.

BUT I need something better -
-  accept as input a structure, Where is the structure definition maintained
? how isi it used ?

Is this possible & how ?

using System;
using System.Collections;
namespace simpleInterface
{
   public struct controlStruct
   {
       public string ateInstrumClass;
       public Hashtable hashParameters;
   }

  public interface IclassTestDLL11
   {
     
       string HeatControl(controlStruct singleControl);
       string ModifyString(string giveInput);
   }
}

Signature

Andrew

Nicholas Paldino [.NET/C# MVP] - 20 Jul 2007 01:30 GMT
Andrew,

   How you have it is fine.  If this is not in a library, then you might
want to consider placing it in a library (structure and interface) if you
intend on sharing it.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>I am new to interfaces. My simple string parameter in & return of string
> worked fine.
[quoted text clipped - 23 lines]
>    }
> }
andrewcw - 20 Jul 2007 01:58 GMT
OK Yes this compiles ok.

I am so relieved !  I must not have renewed my DLL because now I see it..as
type ahead and that also compiles !!

   public string HeatControl(simpleInterface.controlStruct  singleControl)
       {
           string retVal ="";

Super !  Thanks
Signature

Andrew

> Andrew,
>
[quoted text clipped - 29 lines]
> >    }
> > }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.