Topological quantization and cohomology