Ahh the A40, one of my all-time favorite cameras from Canon (it's hard to take a bad picture with that camera when it's placed in "Auto"). But I digress.
Your question comes up several times a day here in the camera section at Fixya. But please note, it's very hard to troubleshoot individual software problems online, and it likely is a software issue. But why put up with the headaches of bad software in the first place?
Please don't take the following as a sales pitch as it's not, but
please see this article, as it describes the use of an inexpensive card reader as a much easier, faster, and less error prone way to download your photos. In fact there are several important reasons discussed in the article for using a card reader vice downloading from the camera. USB Card readers are also very inexpensive these day, with cost virtually not an issue.
Make sure that you find a card reader that is stated capable of reading CF cards. Many of the "all-in-one" readers can do that.