I was also facing the same problem. What I did to solve the problem is given below:
Navigate to Control Panel. Select printer. Then, select Add Printer.
ChooseAdd a local printer. Hit on Create a new port. The default in the drop down box is Local Port. Click Next.
A dialogue box will appear asking for you to enter a port name. Type in the \\computer name\printer name ie.
I have an eMachine T5082 PC running Windows 7 Ultimate with a HP laserjet P2015 and a Samsung CLP-310 series printer connected to it. I also have an ASUS Notebook K40IJ/K50IJ series that has had no problem connecting to the Samsung printer through the network but, will not connect to the HP laserjet. I have installed all the printer drivers from HP's website but still keep getting the same message when I try to install the network printer: "Windows cannot connect to the printer. Operation failed with error 0x0000007e." I did an internet search for error 0x0000007e and found several sites that said that it is a registry problem. So, I ran a registry cleaner and had it fix the errors, but still keep getting the same error message. What can I do to be able to install and use the HP printer with my notebook?