JPEG compression in opengl

My problem is to store JPEGs based on the program below. There are some failures with the
HDC and I simply have no idea how to handle this.
So if somebody is interested, please look through the program and help.

[project](http://members.chello.at/irlweg/Version 2.0.rar)