VB6 APIs to .NET

  • Thread starter Thread starter nolc
  • Start date Start date
N

nolc

Guest
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"?
 
Heres an example:-

<DLLImport("user32")> Function FindWindow(ByVal lpClassName As String, _
ByVal lpWindowName as String) as Integer

and as Ive 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.
 
On the few occasions Ive 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.
 
Back
Top