I have just read your post and felt I had to comment as I can relate to this situation. My own father passed away last month after suffering with cancer, and like you, we all knew the cancer was terminal beforehand.
At the time It didn't feel real, I kept thinking there was a chance he would get better, but even after Chemo and Radiotherapy he got worse, as by then a new cancer had appeared and spread.
Like your father-in-law my dad had a very rough childhood, in fact were only just finding out the true extent to his past now as he had written about it through his creative writing. He became a very depressed adult and we had a very difficult relationship, like your wife had with her father.
I think his upbringing made him very isolated and he was not able to show love or affection, which has always been very difficult to accept, but in recent years he seemed to soften a little. I tried to show I cared by visiting him in hospital, sending a Thinking of You card etc, even just making small talk. We were never going to be really close or even have a good proper conservation, but in the last few weeks of his life I realised I HAD to try, whether he was going to try too or not. I had to make amends as time was running out.
So, basically what I am saying is keep visiting your father-in-law, accept that he may be bitter and depressed because of his up bringing and his situation at the moment, but try not to take it personally. If time is running out, then you and your wife have to do all you can to show you both care,otherwise you may regret it and be left feeling guilty. He sounds very much like my dad. It is very sad when people live very hard lives as it also affects those around them. But its time to change all that.
Sorry this was quite long! Hope it helps a little at least. Take care.