Sorry, I just havent been able to get a GetLastError() function to return anything. That is why I started trying other things. Seems to only cause problems when I try putting something in there. When I do not get any problems, I also do not get any result so I am not sure what I am doing wrong.

I am a complete newb to programming, but unfortunately, have been handed a project that is dealing with a fairly complex program that was downloaded. So most of the code I have posted, I did not actually do. Just trying to get this program to run properly ASAP