View Single Post
Old 23 May 2020, 15:14   #6
Registered User

Join Date: Jun 2016
Location: europe
Posts: 182
Not sure if that's a typo in your actual code or only the snippet you posted, but this line you posted is wrong:
                message+(struct IntuiMessage *)GetMsg(CurrentWindow->UserPort);
and should read:
                message=(struct IntuiMessage *)GetMsg(CurrentWindow->UserPort);
So it should be equivalent to the second GetMsg() call about 10 lines below. And the "operation cannot be performed..." error shouldn't occur.

> and it's still got the original warning about expecting "struct Message *" found "struct IntuiMessage".
Found "struct IntuiMessage" or found "struct IntuiMessage *"? That's a big difference. How is message declared? I pressume it's a pointer (struct IntuiMessage*), otherwise the compiler would complain about a lot of other stuff.
Replace all
                    ReplyMsg((struct Message *)message);
ReplyMsg is a generic function, it accepts all kinds of messages, so you have to cast the argument to a pointer to generic Message in order to quiet the compiler (IntuiMessage is just an extended generic Message, with some extra stuff at the end).
a/b is offline  
Page generated in 0.04335 seconds with 11 queries