C# DLLImport converted to VB.NET DLLImport...what am I missing?

Viewed 9809

In C# I have this:

[DllImport("user32.dll", EntryPoint = "GetDesktopWindow")]
    public static extern IntPtr GetDesktopWindow();

I tried to convert to VB.NET thus:

<DllImport("user32.dll", EntryPoint:="GetDesktopWindow")>
Function GetDesktopWindow() As IntPtr
End Function

But I am getting an error... "Imports System.Runtime.InteropServices.DllImportAttribute cannot be applied to instance method."

Can some explain what I need to do to fix this, and even better, tell me WHY?

Thanks!

1 Answers
Related