Hmm
I've made a test file, i opens 2 bmp's and gets the bits. this works, but if i use your alphablend function my application crashes...
here's the code:
http://pastebin.com/VZrLhVm0
i think it has something todo with the pointers, i'm very new to c