I had this problem for sooooo long. What made it work for me was settings in windows firewall:
1) select advanced settings
2) select incoming rules (my win is not in english - you might have to interpret these steps to your win language)
there you find 2 listings named Command & Conquer Generals: Zero Hour and 2 listings named Generals. For all4 listings individually you need to right-click each one and do these steps:
1) select Properties
2) select Advanced
3) Allow edge traversal in the drop-down menu
On router i have forwarded the ports zero hour use, firewall still up. Ingame options i have no port number in the firewall port override box, because it's already fixed in router and windows firewall. This fixed the problem on my win7 and on my brothers win10.