Accessing Windows.h in C#

In MS Visual C#, what's the equivalent of

"#include <windows.h>" (from MS Visual C++)

The "#include" command isn't recognized and I want to do things with

USHORT* and malloc and what not.  Can one do such a thing?
raw_enhaAsked:
Who is Participating?
 
dstanley9Connect With a Mentor Commented:
You can write .NET-visible classes using C++.NET that internally use memcpy and other "unsafe" methods.  Your public interface, however, needs to use CLR-compliant types - strings, integers, floats, dates, etc.  You can also write C++ DLLs that expose C-style methods that can be called using p-invoke.

I would avoid using COM unless you have to.  
0
 
dstanley9Commented:
Not in C#.  Those are C++ language constructs.  What are you trying to do?
0
 
raw_enhaAuthor Commented:
Well, I have some code that I wanted to convert to C#, but it heavily uses pointers and commands such as malloc and free.

would i be able to write it in C++ and access the code through some sort of DLL or COM object or something?  I'm new to C#, so I'm not sure whats possible.
0
All Courses

From novice to tech pro — start learning today.