VB.NET pinvoke declaration wrong?

Posted by tmighty on Stack Overflow See other posts from Stack Overflow or by tmighty
Published on 2012-11-14T16:58:26Z Indexed on 2012/11/14 16:59 UTC
Read the original article Hit count: 272

Filed under:
|

I copied and pasted the following VB.NET structure from the pinvoke website.

http://www.pinvoke.net/default.aspx/Structures/BITMAPINFOHEADER.html

However when I paste it into a module under the module name like this, VB.NET is telling me that a declaration is expected:

Option Strict Off
Option Explicit On

Imports System
Imports System.Diagnostics
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Runtime.InteropServices
Imports System.Windows.Forms

Module modDrawing

    StructLayout(LayoutKind.Explicit)>Public Structure BITMAPINFOHEADER
    <FieldOffset(0)> Public biSize As Int32
    <FieldOffset(4)> Public biWidth As Int32
    <FieldOffset(8)> Public biHeight As Int32
    <FieldOffset(12)> Public biPlanes As Int16
    <FieldOffset(14)> Public biBitCount As Int16
    <FieldOffset(16)> Public biCompression As Int32
    <FieldOffset(20)> Public biSizeImage As Int32
    <FieldOffset(24)> Public biXPelsperMeter As Int32
    <FieldOffset(28)> Public biYPelsPerMeter As Int32
    <FieldOffset(32)> Public biClrUsed As Int32
    <FieldOffset(36)> Public biClrImportant As Int32
End Structure

Where did I go wrong, please? Thank you very much.

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about pinvoke