在一个另一个文件中 #include一个**dlg.h文件,会发生dlg的资源ID未定义的错误 :
1 在一个另一个文件中 #include一个**dlg.h文件,会发生dlg的资源ID未定义的错误 :
dlg1.h(23) : error C2065: 'IDD_DIALOG1' : undeclared identifier
最简单的方法是在dlg的.h文件头加入 : #include "resource.h"
2 debug assertion failed!
“ASSERT()或VERIFY()语句:这两个宏是用来测试它的参数是否为真的。出现错误这说明你的指针或表达试有问题 。
出错原因肯定就在ASSERT()或VERIFY()语句上,可能空指针、内存泄漏,条件不足、野指针和数组写越界.等等 ”
野指针是指同一个内存区域被释放了两次..
数组写越界就是对超出数组下界的区域进行写数据.
我的错误是 野指针,注释了这行就搞定了 ://delete lpParameter;
在MSDN上:
Evaluates its argument.
ASSERT( booleanExpression)
Parameters
booleanExpression
Specifies an expression (including pointer values) that evaluates to nonzero or 0.
Remarks
If the result is 0, the macro prints a diagnostic message and aborts the program. If the condition is nonzero, it does nothing.
The diagnostic message has the form
assertion failed in file <name> in line <num>
where name is the name of the source file, and num is the line number of the assertion that failed in the source file.
In
the Release version of MFC, ASSERT does not evaluate the expression and
thus will not interrupt the program. If the expression must be
evaluated regardless of environment, use the VERIFY macro in place of
ASSERT.
Note This function is available only in the Debug version of MFC.
In
an MFC ISAPI application, an assertion in debug mode will bring up a
modal dialog box (ASSERT dialog boxes are now modal by default); this
will interrupt or hang the execution. To suppress modal assertion
dialogs, add the following lines to your project source file
(projectname.cpp):
// For custom assert and trace handling with WebDbg
#ifdef _DEBUG
CDebugReportHook g_ReportHook;
#endif
Once
you have done this, you can use the WebDbg tool (WebDbg.exe) to see the
assertions. For information on using the WebDbg tool, see Viewing Trace
Messages And Handling Asserts.
Example
// example for ASSERT
CAge* pcage = new CAge( 21 ); // CAge is derived from CObject.
ASSERT( pcage!= NULL )
ASSERT( pcage->IsKindOf( RUNTIME_CLASS( CAge ) ) )
// Terminates program only if pcage is NOT a CAge*.
3 warning C4312 : conversion from 'LONG' to 'WNDPROC' of greater size
据说,这是因为32位/64位的问题,编译器是警告你代码到64位环境下可能会出问题。
类型转换不要用(LONG_PTR),LongToPtr(),也不要直接用(WNPROC),而是用(WNDPROC)LongToPtr()。
warning C4311: 'type cast' : pointer truncation from 'LRESULT (__stdcall *)(HWND,UINT,WPARAM,LPARAM)' to 'LONG'
在一个另一个文件中 #include一个**dlg.h文件,会发生dlg的资源ID未定义的错误 :的更多相关文章
- Unix - 文件中构成一个空洞的分析
lseek函数显示地为一个打开文件设置偏移量,文件偏移量可以大于文件的当前长度,在这种情况下,对该文件的下一次写将加长该文件,并在文件中构成一个空洞,这一点是允许的.位于文件中但没有写过的字节都被读为 ...
- 快速从mysqldump文件中恢复一个表
快速从较大的mysqldump文件中恢复一个表到数据库中: 1.先获取目标表(md_gas_check_record)在文件中的位置 [publish@LF-PRO-DB-01 ~]$ cat dby ...
- 怎样从一个DLL中导出一个C++类
原文作者:Alex Blekhman 翻译:朱金灿 原文来源: http://www.codeproject.com/KB/cpp/howto_export_cpp_classes.aspx 译 ...
- fatal error LNK1169: 找到一个或多个多重定义的符号或多个.c/.cpp文件想同时调用定义在.h文件里面的全局变量,防止重定义变量问题。
为什么.h文件中不能定义全局变量? 原因: 存在多次创建变量.如果头文件中可以定义全局变量,那么每个包含该头文件的文件里都会有该全局变量的定义.因为C语言的include是直接将文件嵌入到includ ...
- ZeroMQ接口函数之 :zmq_msg_recv - 从一个socket中接受一个消息帧
ZeroMQ 官方地址 :http://api.zeromq.org/4-2:zmq_msg_recv zmq_msg_recv(3) ØMQ Manual - ØMQ/3.2.5 Name zmq_ ...
- 获取一个字符串中每一个字母出现的次数使用map集合
package 获取字符串中单字符出现次数; import java.util.Scanner; import java.util.TreeMap; /* * 需求:获取一个字符串中每一个字母出现的次 ...
- PHP的排列组合问题 分别从每一个集合中取出一个元素进行组合,问有多少种组合?
首先说明这是一个数学的排列组合问题C(m,n) = m!/(n!*(m-n)!) 比如:有集合('粉色','红色','蓝色','黑色'),('38码','39码','40码'),('大号','中号') ...
- String 类中的几个练习--获取指定字符串中,大写字母、小写字母、数字的个数||获取一个字符串中,另一个字符串出现的次数
package cn.homework.demo1; public class GetCount { /* * 获取一个字符串中,另一个字符串出现的次数 * 思想: * 1. indexOf到字符串中 ...
- Java 获取一个字符串中,另一个字符串出现的次数
Java 获取一个字符串中,另一个字符串出现的次数 思想: 1. indexOf到字符串中到第一次出现的索引2. 找到的索引+被找字符串长度,截取字符串3. 计数器++ 代码实现: public cl ...
随机推荐
- Centos7更新阿里yum源
一.下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo 二.备份并替换系统的repo文件 cp Centos-7.repo /etc/ ...
- HDU - 1114 Piggy-Bank 完全背包(背包恰好装满)
Piggy-Bank Before ACM can do anything, a budget must be prepared and the necessary financial support ...
- 利用URL重写隐藏复杂的URL
第一步:模拟映射页面 我们想在一个页面上点击guid.html链接,跳转到比较复杂URL的guid_{492f3e0b-848e-11da-9550-00e08161165f}.html页面.即定义一 ...
- nginx 初了解
随着现代web开发的发展,restful,前后端分离,前端js框架的应用越来越普遍.很多web应用请求的接口可能根本就存在于不同的服务器,类似于微信,支付宝等等.这其中就会存在跨域的问题.简单来说,跨 ...
- Codevs 1159 最大全0子矩阵
1159 最大全0子矩阵 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 题目描述 Description 在一个0,1方阵中找出其中最大的全 ...
- codevs1245 最小的N个和
1245 最小的N个和 题目描述 Description 有两个长度为 N 的序列 A 和 B,在 A 和 B 中各任取一个数可以得到 N^2 个和,求这N^2 个和中最小的 N个.
- VUE之环境安装
一.环境安装 软件安装: nodejs https://nodejs.org/en/ vscode https://code.visualstudio.com/docs/?dv=win python- ...
- 图像像素灰度内插(Matlab实现)
常用的像素灰度内插法:最近邻元法.双线性内插法.三次内插法 %%像素灰度内插 factor = 0.75;%缩放比 u = 0.6;v = 0.7; itp1 = uint8(zeros(ceil(h ...
- Linux命令 查看Linux版本和是否联网
1.查看Linux内核版本 1.1 $ cat /proc/version [heima01@heima01 ~]$ cat /proc/version Linux version 2.6.32-57 ...
- bzoj3159决战 码农题 树剖套splay
最近沉迷码农题无法自拔 首先有一个暴力的想法:对于每个重链维护一个splay,需要翻转的连起来,翻转,接回去 然后发现这样没问题... 一条链只能跨log个重链,也就只有log个splay的子树参与重 ...