debug error File i386\chkesp.c
The valueof ESP was not properly saved across fucntion call.This is usally a result of calling a fucntion declared with one calling convention with a function pointer
declared witha declared calling convention..
In C/C++ settings it is _cdecl convention.
the code is which i am coverting bmp to png format
char *inBuffer = new char[inStreamSize];
uncompressedBufferSize = inStreamSize*40;
unCompressedBuffer = new char[uncompressedBufferSize];
inFile.read (inBuffer, inStreamSize);
zs = new z_stream;
zs->next_in = (unsigned char *)inBuffer; zs->avail_in = inFile.gcount(); zs->next_out = (unsigned char *)unCompressedBuffer; zs->avail_out = uncompressedBufferSize; zs->zalloc = (alloc_func)0;
zs->zfree = (free_func)0;
zs->data_type = Z_BINARY;
ret = inflateInit(zs);
ret = inflate(zs, Z_FINISH);
if(ret != Z_OK && ret != Z_STREAM_END)
AfxMessageBox("Failed to decompress file");
ret = inflateEnd (zs);
if(ret == Z_OK)
outFile.write (unCompressedBuffer, zs->total_out);
delete  zs;
SetDlgItemText(IDC_PROGRESS_TEXT, "1 File Converted");
after this the error occurs.
24 Apr '12 - 18:48
Edited 24 Apr '12 - 18:52
can you identify the line where the error occurs?
as the error message says, this usually happens when you call an external library using the wrong calling convention.
i don't see anything obviously wrong with the code you've shown here. double-check the function declarations for any DLLs you're using.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)