Re: Using GetSystemPaletteEntries
From: Just Me (groups_at_a-znet.com)
Date: 02/18/05
- Next message: Cor Ligthert: "Re: openfiledialog - selecting a folder"
- Previous message: UJ: "Re: Global variables in a project."
- In reply to: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Next in thread: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Reply: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Feb 2005 09:46:59 -0500
Played around a little with Pack= since I don't know what it does for sure
and couldn't find out using Help
Most of my code is VB but I also have a C# library
I'm confused about the ByValArray, since I expect a return it seems like it
should be ByRefArray but that does not exists.
// [StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Auto)]
public struct PALETTEENTRY
{
public byte peRed;
public byte peGreen;
public byte peBlue;
public byte peFlags;
}
//[StructLayout(LayoutKind.Sequential, Pack=2, CharSet=CharSet.Auto)]
public struct LOGPALETTE
{
public short palVersion;
public short palNumEntries;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=256)] public PALETTEENTRY[]
palPalEntry;
}
[DllImport("gdi32", CharSet=CharSet.Auto)] public static extern int
GetSystemPaletteEntries(HDC hdc, int wStartIndex, int wNumEntries, ref
PALETTEENTRY[] lpPaletteEntries);
"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:uzMbXfYFFHA.1932@TK2MSFTNGP14.phx.gbl...
> >I've been trying to debug this but when it executes
> >GetSystemPaletteEntries
>>it bombs. I mean it just dies.
>
> How did you declare the functions and structures?
>
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
- Next message: Cor Ligthert: "Re: openfiledialog - selecting a folder"
- Previous message: UJ: "Re: Global variables in a project."
- In reply to: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Next in thread: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Reply: Mattias Sjögren: "Re: Using GetSystemPaletteEntries"
- Messages sorted by: [ date ] [ thread ]