I am stuck on this, updating from OS3.9 to 4.1FE:
struct Process *ThisProcess=NULL; ThisProcess=((struct ExecBase *)SysBase)->ThisTask; if (ThisProcess->pr_CLI) { // get command line args } // disable requesters wptr=ThisProcess->pr_WindowPtr; ThisProcess->pr_WindowPtr=(APTR)-1L;
The first call gives me GCC warning 'assignment from incompatible pointer type'.
Since the first one doesn't work correctly, the second one crashes when I go to block the system requesters (Please insert volume "xxx")
What is the correct OS4 code for this?
Something like that:
Thank you!
This is not allowed anyway. Use ThisProcess = FindTask(NULL); instead.
Furthermore moving a task pointer to a process pointer should give an incompatible pointer warning. This is correct: ThisProcess = (struct Process *) FindTask(NULL);