Microsoft KB Archive/253317

= BUG: You receive the C4146 warning when you use #import with ActiveX Data Objects (ADO) 2.5 or later =

Article ID: 253317

Article Last Modified on 4/21/2005

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6
 * Microsoft ActiveX Data Objects 2.7

-



This article was previously published under Q253317



SYMPTOMS
When you compile an ActiveX Data Objects (ADO) application in Visual C++ 6.0 by 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:
 * 1) pragma warning(push)
 * 2) pragma warning(disable:4146)
 * 3) import "c:\program files\common files\system\ado\MSADO15.DLL"
 * 4) pragma warning(pop)



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.



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. using namespace ado20; using namespace std; void main {   cout <<" You should see the warning in compiler's debug window"<<endl; }
 * 1) import "C:\Program Files\Common Files\SYSTEM\ADO\MSADO15.DLL" rename_namespace("ado20")
 * 1) include

Keywords: kbtshoot kbbug kbpending KB253317

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.