惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - avisnet

枚举浏览器窗口 关闭弹出式IE浏览器窗口编程 iframe自适应高度 - avisnet - 博客园 FormView 在对话框里面使用ON_UPDATE_COMMAND_UI映射工具条 automation服务器不能创建对象 汇率 无题 [转]猪的爱情故事 在新窗口中打开网页,同时关闭原有窗口 删除文件至回收站而不是永久删除 低层键盘钩子 C++编译器默认声明的成员函数 使用SqlServer模式的会话状态管理 Session Data Is Lost When You Use ASP.NET InProc Session State Mode [转]LINK : warning LNK4089: all references to "xxx.dll" discarded by /OPT:REF VC++中消除警告 const与typedef的中高级使用 在 ASP.NET 中执行 URL 重写
实现集合类的帮助函数
avisnet · 2006-10-13 · via 博客园 - avisnet

集合类的帮助函数:

CompareElements

Indicates whether elements are the same.

CopyElements

Copies elements from one array to another.

DumpElements

Provides stream-oriented diagnostic output.

HashKey

Calculates a hash key.

SerializeElements

Stores or retrieves elements to or from an archive.


使用下面的方法实现CompareElements时,不知道为何CompareElements不会被执行:
template<>
BOOL AFXAPI CompareElements(const CTextBoxButton* pElement1, const CTextBoxButton* pElement2)
{
 ENSURE(pElement1 != NULL && pElement2 != NULL);

 

return pElement1->GetID() == pElement2->GetID();
}

需要将CTextBoxButton*类型重新定义:

typedef CTextBoxButton* PCTextBoxButton;

template<>
BOOL AFXAPI CompareElements(const PCTextBoxButton* pElement1, const PCTextBoxButton* pElement2)
{
 ENSURE(pElement1 != NULL && pElement2 != NULL);

 

return (*pElement1)->GetID() == (*pElement2)->GetID();
}

CTextBoxButton btn;
btn.SetID(10);
CList<CTextBoxButton*, CTextBoxButton*>   m_lstButton.
POSITION pos = m_lstButton.Find(&btn);