#IDCMP IAddress
I had an interesting little experience with the IDCMP Port. I was using
IDCMP through a window to read clicks on gadgets. I would identify the gadgets
clicked by comparing them to the address found in IAddress of the IntuiMessage
structure. This worked perfectly as long as I was only getting I/O from
gadgets.
When I installed a menu strip to my program, I got a strange bug that would
randomly give me an Illegal Address Guru when I would select the menu. I found
that the bug was caused by my treating IAddress as a Gadget pointer even for a
MENUPICK. But the reason it was a seemingly random bug was that IAddress would,
most of the time, hold a legal if useless address. Mostly it was 0x00000000.
Sometimes it was 0xffff0000. These addresses I could treat as Gadget pointers
as long as I didn't actually do anything but read from them, and therefor the
program wouldn't crash.
But occasionally, the value returned in IAddress was 0x00000001 or
0x00000003, which would immediately Guru when I tried to cast it to a Gadget
pointer. This was, of course, because an address is completely illegal to the
68000 processor.
My question is, is the value returned in IAddress SUPPOSED to mean anything
when the IDCMP message isn't a gadget? Specifically MENUPICK and RAWKEY and
CLOSEWINDOW?
Thanks!
-Mike