title: cannot gate index of arrival gate of new message in omnet++ 5.6.1
body: <p>I am following the tictoc tutorial and I want to change the code of tictoc12 so that I'll get the index of the gate from which we received the message so that the message will not send out from the same gate. This is my handleMesssage() function:</p>
  <pre><code>void Txc12::handleMessage(cMessage *msg)
  {
  if (getIndex() == 3) {
      // Message arrived.
      EV &lt;&lt; &quot;Message &quot; &lt;&lt; msg &lt;&lt; &quot; arrived.\n&quot;;
      delete msg;
  }
  else {
      int arrivalGate = msg-&gt;getArrivalGate()-&gt;getIndex();
      EV &lt;&lt; &quot;arrival gate: &quot; &lt;&lt; arrivalGate &lt;&lt; &quot;\n&quot;;
      // We need to forward the message.
      forwardMessage(msg);
  }
  }
  </code></pre>
  <p>and this is the error that i receive:</p>
  <blockquote>
  <p>Simulation terminated with exit code: -1073741819
  Working directory: D:/omnetpp-5.6.1/samples/tictoc
  Command line: tictoc.exe -m -u Qtenv omnetpp.ini</p>
  </blockquote>
  <blockquote>
  <p>Environment variables:
  PATH=;D:\omnetpp-5.6.1\bin;D:\omnetpp-5.6.1\tools\win64\mingw64\bin;D:\omnetpp-5.6.1\tools\win64\usr\bin;;D:/omnetpp-5.6.1/ide/jre/bin/server;D:/omnetpp-5.6.1/ide/jre/bin;D:/omnetpp-5.6.1/ide/jre/lib/amd64;.;D:\omnetpp-5.6.1\bin;D:\omnetpp-5.6.1\tools\win64\mingw64\bin;D:\omnetpp-5.6.1\tools\win64\usr\local\bin;D:\omnetpp-5.6.1\tools\win64\usr\bin;D:\omnetpp-5.6.1\tools\win64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;D:\omnetpp-5.6.1\tools\win64\usr\bin\site_perl;D:\omnetpp-5.6.1\tools\win64\usr\bin\vendor_perl;D:\omnetpp-5.6.1\tools\win64\usr\bin\core_perl;D:\omnetpp-5.6.1;
  OMNETPP_ROOT=D:/omnetpp-5.6.1/
  OMNETPP_IMAGE_PATH=D:\omnetpp-5.6.1\images</p>
  </blockquote>
  <p>Does anyone know what I'm doing wrong?</p>