Jump to content

Good site for anyone who needs to call Win32 functions


Recommended Posts

This site is a Wiki for how to use pinvoke from .NET to call the Win32 APIs. This is also a good ref for those of you who dapple in C#.

I like the site - thanks for posting the link. Is there anything there that isn't on msdn.com? Although I like that it's a wiki...

Link to comment

I think what it mainly give you are c# wrappers for Win32 calls that you can use to build a simple .NET assembly that you can then call from LV easily.

Rats, I missed the user group meeting. angry.gif

For calling Win32 functions, isn't it generally easier to just use the Call By Ref node? Admittedly I haven't paid that much attention to the issue, but from the discussions I remember wrapping dll calls in another dll is only needed when using callbacks. What other benefits do you get?

Link to comment

I think Brian's point was that the pinvoke method wraps up all the error handling, mem alloc and threading issues into a nice .net interface. Not sure as I have not used it yet and I am sure I will learn more as I do. I have called some Win32 stuff in the past and it can be non-trivial if you don't know what you are doing.

Edited by John Lokanis
Link to comment

I think Brian's point was that the pinvoke method wraps up all the error handling, mem alloc and threading issues into a nice .net interface. Not sure as I have not used it yet and I am sure I will learn more as I do. I have called some Win32 stuff in the past and it can be non-trivial if you don't know what you are doing.

.Net Pinvoke may spare you a few mistakes, but I'm sure that if you do not know what you are doing you are still into a lot of trouble. Likely you will get an .Net Exception dialog instead of the Win32 Exception dialog if you mess up pointers but that are minor details. :P

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.