Since I continue to be NOT the MFC guy, I have refrained from answering, but since nobody else seems to have an answer for you, I'll give it a shot.
The dynamic_cast operator works using RTTI. I have heard some compilers don't properly implement this, so it might be your case. Watch out. I only use the Microsoft compiler and it works beautifully, so don't ask me if I know of any others that might not work correctly. :-(
Having said that and assuming your compiler correctly implements RTTI, the variable app should receive either a valid pointer or NULL if the returned object ISN'T of type CPOSAnywhereClientNTApp. You need to add a check in your code for this.
Now, your IP address call: If the object is not of the correct type, that line should just crash the program unless the method getTargetIPAddress() doesn't use any member data. Does it use member data? If it uses member data AND it is not crashing, I think it is safe to say that dynamic_cast is properly doing its job; else the possible problems are:
1. The pointer in app is not of the correct type and the app doesn't crash because getTargetIPAddress() doesn't access member data.
2. The pointer in app is of the correct type but the logic inside getTargetIPAddress() is flawed. In this case, debug.
And one more thing:
Use code tags.
http://cplusplus.com/articles/z13hAqkS/