Home All Groups Group Topic Archive Search About

DEVMODE Structure from C to C# something is missing

Author
14 Aug 2006 4:46 PM
ThunderMusic
Hi,
I have a structure I have to use called DEVMODE for when I want to call
EnumDisplaySettings. you can see the C struct at the address below :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_8nle.asp

I want to use the dmPosition member of this struct...  Unfortunatly all the
translations of this struct from C to C# are missing this element and I
wanted to know if someone here know how to integrate this exact element in
the managed struct...  one of the structs I found (and they all look like
this one) is there :

http://www.pinvoke.net/default.aspx/Structures.DEVMODE

if you look carefully, there are 3 members missing in this translation :
dmPosition, dmDisplayOrientation and dmDisplayFixedOutput...  For what I'm
doing the 2 firsts can be very useful and dmPosition is mandatory, but I
absolutely don't know how to integrate those in the C# struct.

Does someone have any idea on how to do it?

thanks

Author
14 Aug 2006 5:27 PM
Nicholas Paldino [.NET/C# MVP]
ThunderMusic,

    I would say that the VB definition that you refer to on PInvoke.net is
wrong.  There is no POINTL structure exposed in VB, AFAIK.

    You can create the definition yourself.  POINTL is simply defined as:

[StructLayout(LayoutKind.Sequential)]
public struct POINTL
{
    public int x;
    public int y
}

    You can then define the DEVMODE structure correctly.  Once you do,
please update PInvoke.net as well =)

    Hope this helps.


--
          - Nicholas Paldino [.NET/C# MVP]
          - mvp@spam.guard.caspershouse.com

Show quote
"ThunderMusic" <NoSpAmdanlatathotmaildotcom@NoSpAm.com> wrote in message
news:uYSi2D8vGHA.4576@TK2MSFTNGP03.phx.gbl...
> Hi,
> I have a structure I have to use called DEVMODE for when I want to call
> EnumDisplaySettings. you can see the C struct at the address below :
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_8nle.asp
>
> I want to use the dmPosition member of this struct...  Unfortunatly all
> the translations of this struct from C to C# are missing this element and
> I wanted to know if someone here know how to integrate this exact element
> in the managed struct...  one of the structs I found (and they all look
> like this one) is there :
>
> http://www.pinvoke.net/default.aspx/Structures.DEVMODE
>
> if you look carefully, there are 3 members missing in this translation :
> dmPosition, dmDisplayOrientation and dmDisplayFixedOutput...  For what I'm
> doing the 2 firsts can be very useful and dmPosition is mandatory, but I
> absolutely don't know how to integrate those in the C# struct.
>
> Does someone have any idea on how to do it?
>
> thanks
>

AddThis Social Bookmark Button