ADO bug in VC++ 6 SP5 + Processor Pack
-
I have recently installed both SP5 and the Processor Pack to visual C++ 6 and I am having the following problem. When an exception occurs inside a try catch block inside a function that calls ado methods the function crashes (in the debug build) on return. The following code runs fine when compiled with an earlier service pack and no processor pack, but with SP5 + Processor Pack it crashes during the return from the test function. Also if I compile it on a pc with an eariler sp, it will debug and run fine on a machine with the latest sp (as long as you don't try to compile!). The following code has been reduced to the smallest part that I could get it to crash. I compiled it as a Win32 console application and did not change any of the default values. In SP5 + processor pack an access violation occurs when test() returns. This was tested on win2k. I compiled and tested it in debug build only. #include "stdafx.h" // You must change this to match your path #import "D:\program files\common files\system\ado\msado15.dll" \ no_namespace \ rename( "EOF", "adoEOF" ) void test() { _RecordsetPtr pRst = NULL; try { throw "a"; pRst->Open(_variant_t(), _variant_t(),adOpenStatic , adLockReadOnly, adCmdText); } catch (...) { } } int main(int argc, char* argv[]) { test(); return 0; } My question is 1) Has anyone seen this problem? 2) am I doing something wrong?
-
I have recently installed both SP5 and the Processor Pack to visual C++ 6 and I am having the following problem. When an exception occurs inside a try catch block inside a function that calls ado methods the function crashes (in the debug build) on return. The following code runs fine when compiled with an earlier service pack and no processor pack, but with SP5 + Processor Pack it crashes during the return from the test function. Also if I compile it on a pc with an eariler sp, it will debug and run fine on a machine with the latest sp (as long as you don't try to compile!). The following code has been reduced to the smallest part that I could get it to crash. I compiled it as a Win32 console application and did not change any of the default values. In SP5 + processor pack an access violation occurs when test() returns. This was tested on win2k. I compiled and tested it in debug build only. #include "stdafx.h" // You must change this to match your path #import "D:\program files\common files\system\ado\msado15.dll" \ no_namespace \ rename( "EOF", "adoEOF" ) void test() { _RecordsetPtr pRst = NULL; try { throw "a"; pRst->Open(_variant_t(), _variant_t(),adOpenStatic , adLockReadOnly, adCmdText); } catch (...) { } } int main(int argc, char* argv[]) { test(); return 0; } My question is 1) Has anyone seen this problem? 2) am I doing something wrong?
your code where you have
throw "a";
looks well dodgy !!!! maybe you should remove that :cool: