你要#include <afxtempl.h>
解决方案 »
- 在学习CAsyncSocket编程时碰到的问题???
- 今天咋了,弄几个程序全是LNK2019
- 帮帮忙,如何让系统调用屏幕保护程序的设置窗口
- 图像太大时的旋转问题
- winrar crc 失败(密码错误?) 如何解决???
- 我的控件里有个WM_GETDLGCODE消息!在VB6下没法截获!在线等!高分!!高人快来!解决马上给分!
- 进程外组件如何使用MFC?因为我要写数据库啊,十万火急!!!
- 如何修改滚动条滑块的长度??
- 急!请大家帮忙!谢谢!执行完moveFirst后,在Move(long) 报esp错
- 如何读取一个BMP文件的对应坐标的颜色值?VC++
- 在用CDib类的时候,其中有一行#define MEMORY_MAPPED_FILES宏定义好象是在内存中建立一映射文件,但我不是十分的清楚。如果是,它又是怎样做的呢?
- 如何让CStatic 控件获得焦点?
效果一样
Compiling...
StdAfx.cpp
Compiling...
Test.cpp
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(129) : error C2440: 'type cast' : cannot convert from 'class CString' to 'unsigned long'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(1324) : see reference to function template instantiation 'unsigned int __stdcall HashKey(class CString &)' being compiled
TestDlg.cpp
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(129) : error C2440: 'type cast' : cannot convert from 'class CString' to 'unsigned long'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(1324) : see reference to function template instantiation 'unsigned int __stdcall HashKey(class CString &)' being compiled
Generating Code...
Error executing cl.exe.Test.exe - 2 error(s), 0 warning(s)
CMap的定义是:
template< class KEY, class ARG_KEY, class VALUE, class ARG_VALUE >class CMap
可能Key必须是DWORD,int,LPTSTR...之类的简单类型,而不能是一个对象,如CString。虽说Key是一个class,但实际只能是一个数值。
什么地方有相关的例子和资料,帮我找找吧!MSDN 中的例子我看过了,太简单,只用了一个 DWORD 到 String 的 Map。
unsigned int __stdcall HashKey(class CString &)