Ryan,
In all likelyhood neither the DVD player nor the cable box have discrete (separate) power on and power off codes. Normally these type devices have just a single button (command) codes.
For the cable box, I just leave mine on all the time.
For the DVD player, usually power on can be simulated by either a PLAY AND THEN STOP command (a macro) OR a drawer OPEN command. This works well since a power off macro can be constructed by sending PLAY, STOP (to insure it's on), and then the POWER command.
Jim L