DOCUMENT:Q253317 23-AUG-2001 [visualc] TITLE :BUG: Using #import with ADO Causes C4146 Warning in Visual C++ PRODUCT :Microsoft C Compiler PROD/VER:WINDOWS:2.5,2.6; winnt:6.0 OPER/SYS: KEYWORDS:kbVC kbVC600bug kbGrpDSVCDB kbGrpDSMDAC kbDSupport kbADO250bug kbADO260bug kbATM kbado2 ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual C++, 32-bit Enterprise Edition, version 6.0 - Microsoft Visual C++, 32-bit Professional Edition, version 6.0 - Microsoft Visual C++, 32-bit Learning Edition, version 6.0 - ActiveX Data Objects (ADO), versions 2.5, 2.6, 2.7 ------------------------------------------------------------------------------- SYMPTOMS ======== When you compile an ActiveX Data Objects (ADO) application in Visual C++ 6.0 using the #import directive with version 2.5 or 2.6 of Msado15.dll, you may receive the following warning: warning C4146: unary minus operator applied to unsigned type, result still unsigned RESOLUTION ========== Although this problem will most likely have no effect on your application, you can suppress the warning with the following code: #pragma warning(push) #pragma warning(disable:4146) #import "c:\program files\common files\system\ado\MSADO15.DLL" #pragma warning(pop) STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- Save the following code as a .cpp file, and then compile and run the program with Visual C++. Accept the default workspace when prompted. #import "C:\Program Files\Common Files\SYSTEM\ADO\MSADO15.DLL" rename_namespace("ado20") using namespace ado20; #include using namespace std; void main () { cout <<" You should see the warning in compiler's debug window"<