digitalmars.D.bugs - structs within unions bug ?
- Charlie (39/39) Jun 18 2004 import win32.ansi.windows;
- Charlie (4/43) Jun 18 2004 Here it is in readable format
-
Carlos Santander B.
(43/43)
Jun 19 2004
"Charlie"
escribió en el mensaje
import win32.ansi.windows;
struct EventArgs
{
union
{
struct TextSelectionArgs{
int selIndex;
char [] selText;
};
struct IndexSelectionArgs {
int selIndex;
int subSelIndex;
};
struct CoordinateArgs {
int xPos;
int yPos;
int vKey;
};
}
static EventArgs create(WPARAM w, LPARAM l )
{
EventArgs x;
x.wparam = w;
x.lparam = l;
return x;
}
WPARAM wparam;
LPARAM lparam;
}
int main () {
EventArgs args;
args.CoordinateArgs.xPos = 21;
args.CoordinateArgs.yPos = 21;
return 1;
}
$dmd foo.d -I/dmd/include
foo.d(44): no property 'CoordinateArgs' for type 'EventArgs'
Im not sure if this a bug or not, should I be able to do this ?
Charlie
Jun 18 2004
Here it is in readable format
http://www.noidea128.org/cgi-bin/framesource.cgi?id=5649&type=html
C
In article <cb07es$o5s$1 digitaldaemon.com>, Charlie says...
import win32.ansi.windows;
struct EventArgs
{
union
{
struct TextSelectionArgs{
int selIndex;
char [] selText;
};
struct IndexSelectionArgs {
int selIndex;
int subSelIndex;
};
struct CoordinateArgs {
int xPos;
int yPos;
int vKey;
};
}
static EventArgs create(WPARAM w, LPARAM l )
{
EventArgs x;
x.wparam = w;
x.lparam = l;
return x;
}
WPARAM wparam;
LPARAM lparam;
}
int main () {
EventArgs args;
args.CoordinateArgs.xPos = 21;
args.CoordinateArgs.yPos = 21;
return 1;
}
$dmd foo.d -I/dmd/include
foo.d(44): no property 'CoordinateArgs' for type 'EventArgs'
Im not sure if this a bug or not, should I be able to do this ?
Charlie
Jun 18 2004
"Charlie" <Charlie_member pathlink.com> escribió en el mensaje
news:cb07es$o5s$1 digitaldaemon.com
|
| [code]
|
Change EventArgs to:
struct TextSelectionArgs{
int selIndex;
char [] selText;
};
struct IndexSelectionArgs {
int selIndex;
int subSelIndex;
};
struct CoordinateArgs {
int xPos;
int yPos;
int vKey;
};
struct EventArgs
{
union
{
TextSelectionArgs text;
IndexSelectionArgs index;
CoordinateArgs coor;
}
static EventArgs create(WPARAM w, LPARAM l )
{
EventArgs x;
x.wparam = w;
x.lparam = l;
return x;
}
WPARAM wparam;
LPARAM lparam;
}
| Im not sure if this a bug or not, should I be able to do this ?
|
| Charlie
I think that's the expected behavior.
-----------------------
Carlos Santander Bernal
Jun 19 2004









Charlie <Charlie_member pathlink.com> 