struct (c#.net), structure (c.net)

Posted by Stefan Marquardt on 12-Feb-2010 05:53

Hello,

how i can declace structs to use them with GUI for .NET?

VB.Net examples:

Private Structure DEV_BROADCAST_OEM
        Dim dbco_size As Integer
        Dim dbco_devicetype As Integer
        Dim dbco_reserved As Integer
        Dim dbco_identifier As Integer
        Dim dbco_suppfunc As Integer
End Structure

Private Sub HandleOEM(ByRef m As Message)
        Dim oem As DEV_BROADCAST_OEM
        Dim objOem As Object = m.GetLParam(oem.GetType)

        If Not IsNothing(objOem) Then
            oem = DirectCast(objOem, DEV_BROADCAST_OEM)
            If oem.dbco_devicetype = DeviceType.VOLUME Then
                Me.HandleVolume(m)
            End If
        End If
End Sub

All Replies

Posted by jquerijero on 12-Feb-2010 17:40

You can try this;

DEF VAR paraMemPtr AS MEMPTR NO-UNDO

SET-POINTER-VALUE(paramMemptr) = Message:LParam:ToInt32().

someVariable1 = GET-LONG(paramMemptr,1).

someVariable2 = GET-LONG(paramMemptr,5).

someVariable3 = GET-LONG(paramMemptr,9).

and so forth . . .

Google for the constant value of DeviceType.Volume

This thread is closed