"hjgvhv uhhgvjuhv" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| Peter Huang [MSFT] wrote:
| > Hi Raj,
| >
| > So far .NET provides two approaches to interop with unmanaged code.
| > 1. P/Invoke, calling unmanaged C++ legacy DLL from .NET.
| > 2. COM Interop, Calling .NET code from unmanaged COM Client or Calling
| > unmanaged COM server from .NET.
| > Interoperating with Unmanaged Code
| >
http://msdn2.microsoft.com/en-us/library/sd10k43k.aspx
| >
| > But so far .NET did not provide such an approach that make a C# .NET
| > assembly and export function just as legacy C++ DLL do.
| >
| > Now a possible approach is to write a mix-mode managed C++ to wrap the
C#
| > dll just as Carl said.
| >
| > If you have further question about this issue, please feel free to post
| > here and I am happy to be of assistance.
| >
| >
| > Best regards,
| >
| > Peter Huang
| >
| > Microsoft Online Community Support
| > ==================================================
| > When responding to posts, please "Reply to Group" via your newsreader so
| > that others may learn and benefit from your issue.
| > ==================================================
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
|
| I for one would like to have a tutorial on how to access hardware in C#.
|
A tutorial of what? It's just not possible to use .NET to access the
hardware, at least not directly.
| C++ was a pain, and C# is not possible.
|
No it's not possible, but this has nothing to do with C#, which is after all
just a programming language, it's the framework (CLR and FCL) which is not
suited to directly access hardware (devices), this is the domain of device
driver programming using C and/or C++. C# just like any other .NET language
can only access the hardware via the device driver interface.
Willy.