Hello Stewart,
Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou
[MSFT] and I will be working on this issue with you.
The .NET is a new platform with a new programming architecture. It just
provides a parallel programming API similar as the traditional Windows API.
Consequently, the recommended way is always to use the .NET platform API
instead of the native Windows API if we can.
However, if the native Windows API is very necessary in case of some
particular scenario, the .NET has provided the P/Invoke as a bridge to
communicate between the native and managed codes. That is to say, the way
of calling Windows API has changed in C#. The header file has died in the
managed world.
Rudy and others joined in this discussion have already gave some useful
links about the PInvoke signatures and samples. Actually, I want to mention
another useful tool, the P/Invoke Interop Assistant. This tool provides a
visual UI that let you select a Windows API you want to call, or native
structure you want to use, and then it will generate and report the
corresponding DllImport attribute and data structure definition to us.
You can have a look at this MSDN magazine article about how to use the
P/Invoke Interop Assitant tool,
http://msdn.microsoft.com/en-us/magazine/cc164193.aspx
Please let me know if you need any future assistance and I will do my best
to follow up. Have a good day!
Best regards,
Ji Zhou (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.