John Lokanis Posted March 24, 2010 Report Share Posted March 24, 2010 Here is a site that Brian Tyler (formerly of NI, now at MS) recommended for all LV Dev who need to call Win32 functions: http://www.pinvoke.net/ 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#. hope this helps someone... -John Quote Link to comment
crelf Posted March 24, 2010 Report Share Posted March 24, 2010 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... Quote Link to comment
John Lokanis Posted March 24, 2010 Author Report Share Posted March 24, 2010 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. Quote Link to comment
crelf Posted March 24, 2010 Report Share Posted March 24, 2010 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. Ahhh - I see the point now. Nice! Quote Link to comment
Daklu Posted March 24, 2010 Report Share Posted March 24, 2010 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. 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? Quote Link to comment
John Lokanis Posted March 25, 2010 Author Report Share Posted March 25, 2010 (edited) 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 March 25, 2010 by John Lokanis Quote Link to comment
Rolf Kalbermatter Posted March 30, 2010 Report Share Posted March 30, 2010 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.