Is this a good or bad?http://blogs.msdn.com/b/jmstall/archive/2006/03/10/pinvoke-good-or-bad.aspxPinvoke.Net is a great site, and I was wondering whether to be happy or sad. On the bright side, it's great to see a community effort like that, and the site is really useful. On the down side, it's sad that pinvoke would be so complicated that somethingen-USTelligent Evolution Platform Developer Build (Build: 5.6.50428.7875)re: Is this a good or bad?http://blogs.msdn.com/b/jmstall/archive/2006/03/10/pinvoke-good-or-bad.aspx#550490Mon, 13 Mar 2006 18:51:56 GMT91d46819-8472-40ad-a661-2c78acb4018c:550490Mike Stall - MSFTI personally find that Pinvoke can get difficult on more complex signatures; especially when:
<br>- you need to start marshalling complex C-style structures.
<br>- the signature really breaks type-safety (eg, passes back an int that's sometimes a string).<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=550490" width="1" height="1">re: Is this a good or bad?http://blogs.msdn.com/b/jmstall/archive/2006/03/10/pinvoke-good-or-bad.aspx#550117Mon, 13 Mar 2006 04:28:12 GMT91d46819-8472-40ad-a661-2c78acb4018c:550117Kent BoogaartI don't think the problem is that pinvoke is difficult but that remembering the signatures for all the different methods is difficult (not to mention a pointless waste of brain power). It's the same reason we have intellisense.
<br>
<br>Incidentally, there is / was an add in for integrating the pinvoke site within VS.NET 2003: <a rel="nofollow" target="_new" href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=75122f62-5459-4364-b9ba-7b5e6a4754fe">http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=75122f62-5459-4364-b9ba-7b5e6a4754fe</a>. Not sure if it's been updated for VS 2005.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=550117" width="1" height="1">re: Is this a good or bad?http://blogs.msdn.com/b/jmstall/archive/2006/03/10/pinvoke-good-or-bad.aspx#549551Sat, 11 Mar 2006 21:52:28 GMT91d46819-8472-40ad-a661-2c78acb4018c:549551Kevin DenteI find it unfortunate that big chunks of PInvoke.net's declarations are actually already embedded in the .NET framwork - but they've been declared internal so no one else gets to take advantage of them. That forces a lot of wasteful duplication.
<br>
<br>I also wonder why MS didn't provide a lot of the PInvoke.net content themselves (they did something along those lines way back in VB6!). A central respository with VS integration would have been a great resource for MS to provide. Or, alternatively, a Microsoft.Win32.Declarations assembly that could be periodically updated as new declarations are added.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=549551" width="1" height="1">re: Is this a good or bad?http://blogs.msdn.com/b/jmstall/archive/2006/03/10/pinvoke-good-or-bad.aspx#549535Sat, 11 Mar 2006 21:26:50 GMT91d46819-8472-40ad-a661-2c78acb4018c:549535Dan McKinleyI don't think pinvoke is difficult, but I can see how it is very non-obvious to people coming from VB6 or people that have never written any unmanaged code. There are probably more of these developers out there than you realize. For them, pinvoke.net is a godsend.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=549535" width="1" height="1">