Microsoft KB Archive/253317

From BetaArchive Wiki
Knowledge Base

Article ID: 253317

Article Last Modified on 4/21/2005


  • 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


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


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)


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.

#import "C:\Program Files\Common Files\SYSTEM\ADO\MSADO15.DLL" rename_namespace("ado20")
using namespace ado20;
#include <iostream>
using namespace std;
void main ()
    cout <<" You should see the warning in compiler's debug window"<<endl;

Keywords: kbtshoot kbbug kbpending KB253317