// This is a part of the Active Template Library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Active Template Library Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Active Template Library product.
#ifndef __ATLDB_H__
#define __ATLDB_H__
#pragma once
#ifndef _ATL_NO_PRAGMA_WARNINGS
#pragma warning (push)
#pragma warning(disable: 4702) // unreachable code
#endif //!_ATL_NO_PRAGMA_WARNINGS
// OLE DB Provider Support
// Interface Impl Classes
//
// Data Source Object
//
// -Mandatory Interfaces:
// IDBCreateSession
// IDBInitialize
// IDBProperties
// IPersist
//
// Session Object
//
// -Mandatory Interfaces:
// IGetDataSource
// IOpenRowset
// ISessionProperties
//
// -Optional Interfaces:
// IDBCreateCommand
// IDBSchemaRowset
//
// Rowset Object
//
// -Mandatory Interfaces:
// IAccessor
// IColumnsInfo
// IConvertType
// IRowset
// IRowsetInfo
//
// -Optional Interfaces:
// IRowsetIdentity
//
// Command Object
//
// -Mandatory Interfaces:
// ICommand)
// IAccessor)
// ICommandProperties
// ICommandText - derives from ICommand
// IColumnsInfo
// IConvertType
#include <atldef.h>
#if !defined(_ATL_USE_WINAPI_FAMILY_DESKTOP_APP)
#error This file is not compatible with the current WINAPI_FAMILY
#endif
#include <oledb.h>
#include <limits.h>
#include <oledberr.h>
#include <msdadc.h>
#include <atldbcli.h>
#include <atlcoll.h>
#pragma warning(disable: 4244)
#pragma pack(push,_ATL_PACKING)
namespace ATL
{
inline DBROWCOUNT AbsVal(_In_ DBROWCOUNT val)
{
if( val < 0 )
return -val;
else
return val;
}
///////////////////////////////////////////////////////////////////////////
// Forwards
template <class T> class CUtlPropInfo;
class CColumnIds;
///////////////////////////////////////////////////////////////////////////
// Additional Property Flag needed internally
const int DBPROPFLAGS_CHANGE = 0x40000000;
///////////////////////////////////////////////////////////////////////////
// ATL Provider Property Definitions
#define ATLDB_NO_STRING 0x01000011 // Arbitrary value for AtlDumpProperty
///////////////////////////////////////////////////////////////////////////
// ATL Provider Property Debugging Support
inline void WINAPI AtlDumpPropsetIID(
_In_ REFIID iid,
_In_ DWORD dwStatus)
{
USES_CONVERSION_EX;
// Handle the most common ones
TCHAR szPropertySetName[100];
if(InlineIsEqualGUID(iid, DBPROPSET_DATASOURCEALL))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_DATASOURCEALL -"));
}
else if(InlineIsEqualGUID(iid, DBPROPSET_DATASOURCEINFOALL))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_DATASOURCEINFOALL -"));
}
else if(InlineIsEqualGUID(iid, DBPROPSET_ROWSETALL))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_ROWSETALL -"));
}
else if(InlineIsEqualGUID(iid,DBPROPSET_DBINITALL))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_DBINITALL -"));
}
else if(InlineIsEqualGUID(iid,DBPROPSET_SESSIONALL))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_SESSIONALL -"));
}
if(InlineIsEqualGUID(iid, DBPROPSET_DATASOURCE))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_DATASOURCE -"));
}
else if(InlineIsEqualGUID(iid, DBPROPSET_DATASOURCEINFO))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_DATASOURCEINFO -"));
}
else if(InlineIsEqualGUID(iid, DBPROPSET_ROWSET))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_ROWSET -"));
}
else if(InlineIsEqualGUID(iid,DBPROPSET_DBINIT))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_DBINIT -"));
}
else if(InlineIsEqualGUID(iid,DBPROPSET_SESSION))
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName),_T("DBPROPSET_SESSION -"));
}
else
{
LPOLESTR lpszName = NULL;
if (SUCCEEDED(StringFromCLSID(iid, &lpszName)))
{
Checked::tcscpy_s(szPropertySetName,
_countof(szPropertySetName),
SAL_Assume_notnull_for_opt_z_(OLE2T_EX(lpszName, _ATL_SAFE_ALLOCA_DEF_THRESHOLD)));
}
else
{
Checked::tcscpy_s(szPropertySetName, _countof(szPropertySetName), _T("Unknown DBPROPSET -"));
}
}
if (dwStatus & 0x04 /* GETPROP_ERRORSOCCURRED */)
{
Checked::tcscat_s(szPropertySetName, _countof(szPropertySetName), _T(" NOT FOUND\n"));
}
else
{
Checked::tcscat_s(szPropertySetName, _countof(szPropertySetName), _T(" FOUND\n"));
}
OutputDebugString(szPropertySetName);
}
inline void WINAPI AtlDumpProperty(
_In_ DWORD dwPropertyID,
_In_ DWORD dwStatus)
{
TCHAR szProperty[100];
TCHAR szStatus[24];
switch(dwStatus)
{
case DBPROPSTATUS_OK:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("FOUND"));
break;
case DBPROPSTATUS_NOTSUPPORTED:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("NOT SUPPORTED"));
break;
case DBPROPSTATUS_BADVALUE:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("BAD VALUE"));
break;
case DBPROPSTATUS_BADOPTION:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("BAD OPTION"));
break;
case DBPROPSTATUS_BADCOLUMN:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("BAD COLUMN"));
break;
case DBPROPSTATUS_NOTALLSETTABLE:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("NOT ALL SETTABLE"));
break;
case DBPROPSTATUS_NOTSETTABLE:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("NOT SETTABLE"));
break;
case DBPROPSTATUS_NOTSET:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("NOT SET"));
break;
case DBPROPSTATUS_CONFLICTING:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("CONFLICTED"));
break;
case ATLDB_NO_STRING:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("WARNING! NO RESOURCE STRING FOR THIS PROPERTY! ADD IDS_<PROP_NAME>"));
break;
default:
Checked::tcscpy_s(szStatus, _countof(szStatus), _T("INDETERMINATE"));
break;
}
_stprintf_s(szProperty, _countof(szProperty), _T("Property 0x%lxL -- %s\n"), dwPropertyID, szStatus);
OutputDebugString(szProperty);
}
///////////////////////////////////////////////////////////////////////////
// Defines for debugging properties
#ifdef _ATL_DEBUG_PROVIDER_PROPS
#define _ATLDUMPPROPSETIID(iid, dwStatus) AtlDumpPropsetIID(iid, dwStatus)
#define _ATLDUMPPROPERTY(dwPropertyID, dwStatus) AtlDumpProperty(dwPropertyID, dwStatus)
#else
#define _ATLDUMPPROPSETIID(iid, dwStatus)
#define _ATLDUMPPROPERTY(dwPropertyID, dwStatus)
#endif // _ATL_DEBUG_PROVIDER_PROPS
// ------------- STRUCTURE DEFINITIONS -----------------------------------
struct UPROPVAL
{
DBPROPOPTIONS dwOption;
CColumnIds* pCColumnIds;
DWORD dwFlags;
VARIANT vValue;
};
struct UPROPINFO
{
DBPROPID dwPropId;
ULONG ulIDS;
VARTYPE VarType;
DBPROPFLAGS dwFlags;
union
{
DWORD_PTR dwVal;
LPOLESTR szVal;
};
DBPROPOPTIONS dwOption;
};
struct UPROP
{
ULONG cPropIds;
UPROPINFO** rgpUPropInfo;
UPROPVAL* pUPropVal;
};
struct PROPCOLID
{
DBID dbidProperty; // The column id information
DBPROPOPTIONS dwOption;
VARIANT vValue;
};
typedef PROPCOLID* PPROPCOLID;
struct UPROPSET
{
const GUID* pPropSet;
ULONG cUPropInfo;
UPROPINFO* pUPropInfo;
DWORD dwFlags;
bool bIsChained;
};
struct ATLBINDINGS
{
DBBINDING* pBindings;
DWORD dwRef;//DBREFCOUNT dwRef;
DBCOUNTITEM cBindings;
DBACCESSORFLAGS dwAccessorFlags;
};
struct ATLCOLUMNINFO
{
LPOLESTR pwszName;
ITypeInfo *pTypeInfo;
DBORDINAL iOrdinal;
DBCOLUMNFLAGS dwFlags;
DBLENGTH u
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
ATL+WTL,Windows平台仍然是一对锋利的组合。 主要特点: http://blogs.msdn.com/b/vcblog/archive/2013/08/20/atl-and-mfc-changes-and-fixes-in-visual-studio-2013.aspx One of the major changes we made was to eliminate the ATL DLL altogether. All ATL code is now static, either in the header files or in the ATL static library. We also reduced the amount of code in the ATL static library substantially, so there are no longer multiple static libraries for debug/release mode or Unicode/ANSI character set. There is only one ATL static library that is common to all configurations.
资源推荐
资源详情
资源评论
收起资源包目录
atl2013.rar (69个子文件)
lib
amd64
atls.lib 922KB
atls.pdb 1.55MB
atls.lib 1.21MB
atls.pdb 1.54MB
include
atlhost.h 80KB
atlstr.h 35KB
ATLComMem.h 5KB
atlwinverapi.h 4KB
afxv_cpu.h 919B
atlsafe.h 17KB
atlsecurity.h 152KB
atlrc.h 953B
cstringt.h 83KB
atlcore.h 16KB
atltypes.h 20KB
atldbcli.h 201KB
l.fra
atlres.rc 1KB
atlcomcli.h 89KB
atliface.idl 14KB
atlsimpcoll.h 11KB
atlstdthunk.h 8KB
atldbgmem.h 18KB
atlplus.h 28KB
atlbase.h 209KB
atlctl.h 119KB
atlcoll.h 100KB
atlbuild.h 578B
atltrace.h 15KB
atlxml.h 14KB
atlimage.h 48KB
atlpreviewctrlimpl.h 5KB
l.chs
atlres.rc 990B
atldef.h 20KB
atlsnap.h 45KB
atlconv.h 36KB
atldbsch.h 39KB
atlevent.h 13KB
l.jpn
atlres.rc 1KB
atliface.h 91KB
atldb.h 382KB
ATLComTime.h 29KB
l.esn
atlres.rc 1KB
atlalloc.h 18KB
atltransactionmanager.h 27KB
atlcom.h 180KB
l.ita
atlres.rc 1KB
atlsimpstr.h 24KB
atlfile.h 17KB
atlpath.h 17KB
atlres.rc 1KB
atlhandler.h 6KB
atlcur.h 10KB
l.deu
atlres.rc 1KB
atlexcept.h 3KB
atlsync.h 12KB
atlmem.h 5KB
l.rus
atlres.rc 1KB
atlacc.h 30KB
atltime.h 26KB
l.cht
atlres.rc 996B
atlchecked.h 10KB
atlenc.h 30KB
statreg.h 40KB
atlhandlerimpl.h 29KB
l.kor
atlres.rc 1KB
atlutil.h 95KB
atlwin.h 138KB
about_.rc 3KB
atlsocket.h 7KB
共 69 条
- 1
资源评论
- upwinder2015-03-31看不太懂哦,还得多学习。
- hpking2014-09-22还没用,不过看这应该不错的
老邓
- 粉丝: 1014
- 资源: 31
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功