Hey FZ6guti, A Welcome from me too!
Both cameras are great. Both solid and reliable.. You may be inclined to go for the D40x with the wide range of lenses available. But remember as Fearless Leader said it will not autofocus with any [non] AF-S or Af-I lenses.
I havent had any experience with the K10d, but i have heared nothing but good things about it. Weather sealing, Shake reduction and Dust removal system to name a few!. I think a few of the forum members have a K10d. Have you read Rei_Vileo's review of the K10d?.
Not much info but hope it helped