Hello all,
I've recently decided to learn C++, and my lack of motivation to do so has been that I learned C first. Unfortunately I never learned it in depth, and I certainly don't know C++ in depth.
So, yes, I'm another newbie.
I have a program which compiles, and works, but if I use VC++ 6.0 to compile it, I get ESP errors. I've done quite a bit of looking around the net, and I keep coming back to what the compiler tells me.
******************************************
The value of ESP was not properly saved across a
function call. This is usually a result of calling
a function declared with one calling convention with
a function pointer declared with a different calling
convention.
******************************************
I've attached the source file so everyone can see what I'm talking about.
That's a bit cryptic for me, but some of you I'm sure it's obvious.
Here is a couple things I do know:
* This program properly compiles
* This program properly executes once compiled (and linked) using DevCpp 4 or DevCpp beta 5 w/mingw32
* The program will compile and link with MS VC++ 6.0, but will NOT execute properly.
* I'm using URLDownloadToFile API, and LoadLibrary along with all other required functions for that concept to work.
I originally used urlmon.lib to link with a previous project with VC++ 6.0, but I wanted to develop this application (this source file is just a small module of a larger project I'm translating, it's actually just one function) to use API calls from dlls rather than compiling using implicit linking and extra header files.
DevCpp wouldn't compile too well with the old method. It now compiles flawlessly.
I just don't understand everything that is going on. I really don't understand why VC 6.0 is complaining like it is.
I apologize for the length of the post, but I'm new and a bit flustered with all of the time I've spent trying to figure it out. C++ can be kinda' daunting...
Thanks.
~ DM
If anyone can look at the attached file and give me some hints as to what's going on, I would greatly appreciate it.
------------------------------------------------------------------------
As of March 14, 2003, this problem has been fixed. Download new source and/or read the following posts to see fix for problem. Thanks for everyone's help.