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未定义的错误 :的更多相关文章

  1. Unix - 文件中构成一个空洞的分析

    lseek函数显示地为一个打开文件设置偏移量,文件偏移量可以大于文件的当前长度,在这种情况下,对该文件的下一次写将加长该文件,并在文件中构成一个空洞,这一点是允许的.位于文件中但没有写过的字节都被读为 ...

  2. 快速从mysqldump文件中恢复一个表

    快速从较大的mysqldump文件中恢复一个表到数据库中: 1.先获取目标表(md_gas_check_record)在文件中的位置 [publish@LF-PRO-DB-01 ~]$ cat dby ...

  3. 怎样从一个DLL中导出一个C++类

    原文作者:Alex Blekhman    翻译:朱金灿 原文来源: http://www.codeproject.com/KB/cpp/howto_export_cpp_classes.aspx 译 ...

  4. fatal error LNK1169: 找到一个或多个多重定义的符号或多个.c/.cpp文件想同时调用定义在.h文件里面的全局变量,防止重定义变量问题。

    为什么.h文件中不能定义全局变量? 原因: 存在多次创建变量.如果头文件中可以定义全局变量,那么每个包含该头文件的文件里都会有该全局变量的定义.因为C语言的include是直接将文件嵌入到includ ...

  5. 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_ ...

  6. 获取一个字符串中每一个字母出现的次数使用map集合

    package 获取字符串中单字符出现次数; import java.util.Scanner; import java.util.TreeMap; /* * 需求:获取一个字符串中每一个字母出现的次 ...

  7. PHP的排列组合问题 分别从每一个集合中取出一个元素进行组合,问有多少种组合?

    首先说明这是一个数学的排列组合问题C(m,n) = m!/(n!*(m-n)!) 比如:有集合('粉色','红色','蓝色','黑色'),('38码','39码','40码'),('大号','中号') ...

  8. String 类中的几个练习--获取指定字符串中,大写字母、小写字母、数字的个数||获取一个字符串中,另一个字符串出现的次数

    package cn.homework.demo1; public class GetCount { /* * 获取一个字符串中,另一个字符串出现的次数 * 思想: * 1. indexOf到字符串中 ...

  9. Java 获取一个字符串中,另一个字符串出现的次数

    Java 获取一个字符串中,另一个字符串出现的次数 思想: 1. indexOf到字符串中到第一次出现的索引2. 找到的索引+被找字符串长度,截取字符串3. 计数器++ 代码实现: public cl ...

随机推荐

  1. <c和指针>学习笔记4之字符串

    1 字符串基础 NUL字节是字符串的终止符,但它本身并不是字符串的一部分,所以字符串的长度并不包括NUL字节. (1)字符串长度 size_t strlen(char const * string)注 ...

  2. 微信小程序开发之拼接json数组字符串

    直接上代码   : var imageitem;    var imageitemstring='';    for(var i=0;i< that.data.fbimages.length;i ...

  3. shell程序---编译目录下全部.c或.cpp文件

    今天大波又提起昨天我说的那个程序.这样的,起初我想写一个makefile,每次写完新代码后一键编译目录下所有的.cpp文件. 原因是用makefile的话,每次要把目标文件加紧去才能编译.感觉不方便. ...

  4. UVa 1335 Beijing Guards (二分+贪心)

    题意:n 个人成一个圈,每个人想要 ri 种不同的礼物,要求相邻两个人没有相同的,求最少需要多少礼物. 析:如果 n 是偶数,那么答案一定是相邻两个人的礼物总种数之和的最大值,那么如果是奇数,就没那么 ...

  5. POJ - 3037 Skiing SPFA

    Skiing Bessie and the rest of Farmer John's cows are taking a trip this winter to go skiing. One day ...

  6. iOS证书和描述文件的配置

    1.登录Apple开发者账号,进入Apple Developer主页,点击Account 2.点击Certificates,ID&Profiles 3.生成CRS文件 1.打开mac上的钥匙串 ...

  7. ASP.NET自定义控件组件开发

    ASP.NET的开发都是事件驱动的,现在我们就来为控件添加事件.在事件之前 对委托事件要要熟悉. 其实定义事件的步骤很简单: 1.声明一个委托. 2.定义一个携带事件信息的类. 3.定义事件 4.定义 ...

  8. 手动配置webpack之React

    安装 1.安装react转译相关依赖包: npm安装:             npm install --save-dev babel-core babel-loader babel-preset- ...

  9. linux mysql 简单记录

    mysql 1.linux下启动mysql的命令:mysqladmin start/ect/init.d/mysql start (前面为mysql的安装路径) 2.linux下重启mysql的命令: ...

  10. [NOIP2014]子矩阵

    1812. [NOIP2014]子矩阵 http://www.cogs.pro/cogs/problem/problem.php?pid=1812 ★★★   输入文件:submatrix.in   ...