Make sure you placed the parentheses at the correct places. Otherwise you have a good chance of casting the wrong struct.

Don't write this:

(ESscreenStruct*)testDefStruct->specific

Correct is either this:

((ESscreenStruct*)testDefStruct)->specific

Or this:

((ESscreenStruct*)(testDefStruct->specific))

dependent on what you want to cast.