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. qpython 读入数据问题: EOF error with input / raw_input

    直接使用input会报错 EOF error with input / raw_input 原因是在qpy里console mode 命令行模式不是完全和pc上的命令行一致,所以input和raw_i ...

  2. pow()函数的精度问题

    妈蛋这个坑了我大半个小时都想不出个原因..后来看到pow的定义才想起,数据类型很重要啊.. 1.底数用常量,指数用整型 #include <stdio.h> #include <ma ...

  3. mysql由浅入深探究(二)----mysql用户操作

    上一节我们完成了mysql的安装,现在我们将开启实战模式,完成一些基本的mysql操作.这节我们分为一些几个内容: mysql中用户新建 mysql中用户删除 mysql中用户修改 mysql中用户查 ...

  4. 洛谷P2905 [USACO08OPEN]农场危机Crisis on the Farm

    P2905 [USACO08OPEN]农场危机Crisis on the Farm 题目描述 约翰和他的奶牛组建了一只乐队“后街奶牛”,现在他们正在牧场里排练.奶牛们分成一堆 一堆,共1000)堆.每 ...

  5. 爬虫之scapy

    一 介绍 Scrapy一个开源和协作的框架,其最初是为了页面抓取 (更确切来说, 网络抓取 )所设计的,使用它可以以快速.简单.可扩展的方式从网站中提取所需的数据.但目前Scrapy的用途十分广泛,可 ...

  6. Kali Linux 工具清单

    Kali Linux 工具清单 Information Gathering acccheck ace-voip Amap Automater bing-ip2hosts braa CaseFile C ...

  7. Java8 中的 Optional

    从 Java 8 引入的一个很有趣的特性是 Optional  类.Optional 类主要解决的问题是臭名昭著的空指针异常(NullPointerException) —— 每个 Java 程序员都 ...

  8. DRF教程8-过滤

    在写后端api时,经常需要使用各种过滤条件,可以使用Q对查询集进行过滤,这里介绍一个新玩意儿 以下是基础文档 https://django-filter.readthedocs.io/en/maste ...

  9. Vue中登录模块

  10. Linux下处理^M字符

    很多时候windows环境中编辑过的文件,在Linux下经常会出现^M字符,可以通过以下方式处理该字符. vim命令打开文件,然后在vim命令模式下输入以下内容: :%s/^M//g特别注意:注意^M ...