Guest nolc Posted July 10, 2002 Posted July 10, 2002 As anyone seen anything on "How to convert VB6 APIs to .NET?" or have an understanding ont "How to use VB6 APIs in a .NET application"? Quote
Guest TheIrishCoder Posted July 11, 2002 Posted July 11, 2002 Heres an example:- <DLLImport("user32")> Function FindWindow(ByVal lpClassName As String, _ ByVal lpWindowName as String) as Integer and as I've done above all Integers must be converted to Shorts and Long to Integer when copying from vb6. You can use the Declare statement but this seems to be the recommended way of doing it in .net. Also you only use ByRef for structures as far as I know. Quote
*Gurus* divil Posted July 11, 2002 *Gurus* Posted July 11, 2002 On the few occasions I've required to do this, I just copy it out of the old API viewer and paste it in to VB.NET, change Longs to Integers, (or sometimes IntPtrs), and it works. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts