interface function has structure parameter.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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);
}
}
 
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.
 
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
--
Andrew


Nicholas Paldino said:
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.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

andrewcw said:
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);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top