Casting a function parameter from void* to actual
<p>I have a routine that gets passed a void* to a structure.  In the
routine I cast it to the correct type, e.g.</p>

<pre><code>SomeFunc(void* pMsg) {
  printf("Event = %d\n", static_cast&lt;struct MyEventMsg*&gt;(pMsg)-&gt;Event);
}
</code></pre>

<p>If I am accessing many members of the structure the code looks pretty
messy.  I can create a new pointer of the correct type and assign it
the cast void*, but it seems like it shouldn't be necessary to create
a temporary variable just for this purpose.  Is there some way to cast
the parameter pMsg to the correct type?</p>

<p>Thanks
Doug</p>
