DEVMODE Structure from C to C# something is missing

  • Thread starter Thread starter ThunderMusic
  • Start date Start date
T

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
 
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.
 
Back
Top