C# API

  • Thread starter Thread starter Manjree Garg
  • Start date Start date
M

Manjree Garg

Hi,

I am new to C#. I need to know hoe to write C# API. If somebody can point
in right direction ; where to look at e.g. some link and example etc. that
will be great.

Cheers.

Manj.
 
Hello Manjree,

What does "C# API" mean?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


MG> Hi,
MG>
MG> I am new to C#. I need to know hoe to write C# API. If somebody
MG> can point in right direction ; where to look at e.g. some link and
MG> example etc. that will be great.
MG>
MG> Cheers.
MG>
MG> Manj.
MG>
 
It means a C# Application programming interface from which I can call
different function/routines and pass input to those functions and get the
outputs.

Manj.
 
Manjree Garg said:
It means a C# Application programming interface from which I can call
different function/routines and pass input to those functions and get
the outputs.

Create a "class library" project and put the methods
(functions/routines) in there. If you don't want to have to create an
object to call the methods, then make it a static class.

Eq.
 
Hello Manjree,

I strongly recommend to start from "Framework Guidelines" book http://www.amazon.com/Framework-Des...bs_sr_2?ie=UTF8&s=books&qid=1205238445&sr=8-2
it's the second edition (will be released in September), but previous one
is available

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


MG> It means a C# Application programming interface from which I can
MG> call different function/routines and pass input to those functions
MG> and get the outputs.
MG>
MG> Manj.
MG>
MG> "Michael Nemtsev [MVP]" wrote:
MG>
Hello Manjree,

What does "C# API" mean?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

MG> Hi,
MG>
MG> I am new to C#. I need to know hoe to write C# API. If somebody
MG> can point in right direction ; where to look at e.g. some link
and
MG> example etc. that will be great.
MG>
MG> Cheers.
MG>
MG> Manj.
MG>
 
Manjree said:
It means a C# Application programming interface from which I can call
different function/routines and pass input to those functions and get
the outputs.

In C#, you don't program to an API, like you did in Win32. You simply
write classes, put them in an assembly, and every .NET program can use
them.

Now, using existing API functions from a Win32 DLL is different. You'll
have to use something like P/Invoke. Have a look here:

http://pinvoke.net

And writing a DLL that can be used from Win32 is different again.
Others may be able to fill in here.
--
Rudy Velthuis http://rvelthuis.de

"There is no reason anyone would want a computer in their home."
-- Ken Olson, president, chairman and founder of Digital
Equipment Corp., 1977
 
Manjree Garg said:
It means a C# Application programming interface from which I can call
different function/routines and pass input to those functions and get the
outputs.

In which case what you want to build is a Class Library. That's the
project type you want - beyond that it's a bit hard to know what
question you're specifically asking.
 
Rudy Velthuis said:
In C#, you don't program to an API, like you did in Win32. You simply
write classes, put them in an assembly, and every .NET program can use
them.

That *is* an API. The BCL is an API. It's a programming interface for
use by applications (and anything else, really).
 
Jon said:
That is an API. The BCL is an API.

Sure, you are right. But it is not what most people mean when they
write about an API, especially those new to .NET and/or C#. I meant the
classical Win32 kind of API.
It's a programming interface for use by applications (and anything
else, really).

Indeed.

--
Rudy Velthuis http://rvelthuis.de

"A husband is what is left of the lover after the nerve has been
extracted."
-- Helen Rowland (1876-1950)
 
There are actually a series of MSDN webcasts that explain how to design APIs
but damn if I can find the URL anywhere in this mess I no longer can call
"Favorites" as managing them is a nightmare --but-- Microsoft has spoken to
use that want to develop APIs which we can publish to the public to allow
our software functionality to become accessible to others.

Generally speaking, providing 3rd party access to software program(a) or
proprietary code is what an A(pplication) P(rogramming) I(nterface) is
intended to be used for.

So Manjree, now that I told you where to learn how you go to find the
Microsoft webcasts and come back here to tell us (me) the URL so I can watch
them again. Deal or no deal?

<%= Clinton Gallagher
 
Back
Top