1.检测程序中的括号是否匹配
把光标移动到需要检测的括号(如大括号{}、方括号[]、圆括号()和尖括号<>)前面,键入快捷键“Ctrl+]”。如果括号匹配正确,光标就跳到匹配的括号处,否则光标不移动,并且机箱喇叭还会发出一声警告声。
2.格式化一段乱七八糟的源代码
选中那段源代码,按ATL+F8。
3.在编辑状态下发现成员变量或函数不能显示
删除该项目扩展名为.ncb文件,重新打开该项目。
4.如何整理ClassView视图中大量的类
可以在classview 视图中右键新建文件夹(new folder),再把具有相近性质的类拖到对应的文件夹中,使整个视图看上去清晰明了。
5.定位预处理指定
在源文件中定位光标到对称的#if, #endif,使用Ctrl+K.
6.如何添加系统中Lib到当前项目
在Project | Settings | Link | Object/library modules:输入Lib名称,不同的Lib之间用空格格开.
7.如何在Studio使用汇编调试
在WorkBench的Debugger状态下按CTRL+F7.
8.怎样处理ClassZiard找不到的系统消息
如果要在ClassWizard中处理WM_NCHITTEST等系统消息,请在ClassWizard中Class Info页中将Message filter改为Window就有了.
9.如何干净的删除一个类
先从Workspace中的FileView中删除对应的.h和.cpp文件,再关闭项目,从实际的文件夹中删除对应的.h和.cpp文件与.clw文件。
10.在Studio中快速切换两个文件
有时,我们需要在最近使用的两个文件中快速切换,换Ctrl+F6。这在两个文件不相今的时候就有用的。
11.取得源程序预处理后的结果
在Studio里,可以在->PROJECT->SETTINGS->C/C++->Project Options中,在最后加上 /P /EP 这两个编译开关即可做到”只进行预处理”.就可以了。编译以后就可以在源程序目录中发现“文件名.I ”的文本文件。这就是预处理后的结果。 (注意注:区分大小定,请用大定/P)
12.在Debug模式中查看WINAPI调用后的返回值
很简单,且实用:在watch中加入@hr,err。在CSDN的文档中心有一篇讲得更细,请参考。
13.产生指定源程序文件的汇编代码
从IDE菜单的Project->Setting打开项目设置,按如下文件做:
1.先在左边选择指定文件,可以多选。
2.在右边的C++属性页中,在category中选择List Files,接着在下面的List Files Type中选择Assembly and source code(或选择其它),最后在List File Name中输入在个C/C++源文件产生的相应的汇编代码的文件。
3.编译整个工程。
14.手工编译纯资源成dll
Rc.exe /v data.rc Cvtres.exe /machine:ix86 data.res Link /SUBSYSTEM:WINDOWS /DLL /NOENTRY data.res ;编译成DLL文件 这种方式创建的DLL是最小的,比起你用Win 32 Dynamic Libray等产生的更小。
附:VC项目文件说明
.dsp 项目参数配置文件,这个文件太重要,重点保护对象。
.dsw 工作区文件,重要性一般,因为它信息不多,容易恢复。以下文件在项目中是可丢弃的,有些文件删除后,VC会自动生成的。
.clw ClassWizard信息文件,实际上是INI文件的格式,有兴趣可以研究一下.有时候ClassWizard出问题,手工修改CLW文件可以解决.如果此文件不存在的话,每次用ClassWizard的时候绘提示你是否重建.
.ncb 无编译浏览文件(no compile browser)。当自动完成功能出问题时可以删除此文件。build后会自动生成。
.opt 工程关于开发环境的参数文件。如工具条位置等信息;(可丢弃)
.aps (AppStudio File),资源辅助文件,二进制格式,一般不用去管他.
.plg 是编译信息文件,编译时的error和warning信息文件(实际上是一个html文件),一般用处不大.在Tools->Options里面有个选项可以控制这个文件的生成.
.hpj (Help Project)是生成帮助文件的工程,用microsfot Help Compiler可以处理
.mdp (Microsoft DevStudio Project)是旧版本的项目文件,如果要打开此文件的话,会提示你是否转换成新的DSP格式.
.bsc 是用于浏览项目信息的,如果用Source Brower的话就必须有这个文件.如果不用这个功能的话,可以在Project Options里面去掉Generate Browse Info File,可以加快编译速度.
.map 是执行文件的映像信息纪录文件,除非对系统底层非常熟悉,这个文件一般用不着.
.pch (Pre-Compiled File)是预编译文件,可以加快编译速度,但是文件非常大.
.pdb (Program Database)记录了程序有关的一些数据和调试信息,在调试的时候可能有用.
.exp 只有在编译DLL的时候才会生成,记录了DLL文件中的一些信息.一般也没什么用.
Category Archives: 落花流水
manuscript of my presentation
Good afternoon everyone. I am glad to give you my presentation, about 3G wireless communication system.
You may hear about CDMA 2000 of China Unicom, it is nearly a 3G system but not yet. Then what is 3G exactly?
3G is one step of personal communication system. The ultimate goal of personal communication system is to provide communication service anytime, anywhere, between any pair, in any required form.
To achieve this goal, two aspects should be ready. First, to provide service for every one, the whole system should have a high capacity, so the first problem is the bandwidth requirement. Officially, we define a connection over 384kbps to be a Broadband connection. Maybe it is a little boring for unprofessional one, so, let me show an example. When you connect to USTC Video Server to watch TV program online, the bandwidth you take up is about 300kbps, which is quite enough for a high quality VOD service. The common Internet cable access in dormitory is 100Mbps to desktop.
However, conditions in wireless environment are more complex. A direct consequence is that it is more difficult to achieve as broad bandwidth as under cable environment. So, in 3G systems, we apply some key technology to improve bandwidth condition. A typical one is CDMA- Code Division Multiple Access.
Secondly, providing service in any required form calls for multiformity of communication system. As we know, we can gain every kind of communication through Internet. In another word, service based on Internet has maturely developed. It is easy to develop wireless service based on Internet. In another aspects, Internet is most popular Communication network now, joining with Internet will bring about huge advantages.
To Provide service everywhere and every when means wireless signal should cover as more areas and base stations in system should power on as long as possible, which is not going to be focused on today.
In current system, when you want to send or receive emails, you need a PC connected to the internet; when you want to watch some TV programs you need a TV set; when you want to talk to a friend far away form you, you need a phone, even a cell phone. However, all of these will change after 3G, all you need is just a single Mobile Station providing all kinds of service. 3G, makes life more easily.
Thanks for your listening and cooperation.
今天John怒了,准备了一周的course没能上演
An Open Letter to …… PH.D Class IV
it is with heavy heart that this letter is being written to this class of students. the events that transpired during the week of april 13th was substandard and not befitting a class of this caliber or level of studies.
when one student leaves during class time, without permission to pick up a fedex parcel, is met by me in the hallway and when asked whether permission was granted, the answer was……”My phone did not ring!” how did the student know that there was a parcel waiting? i believe more attention is paid to look at a cell phone than what is going on in the classroom. that indicates to me where the priorites are!
each student was notified and wared for 4 weeks that personal presentation would start and what was the result? one student was laughing through most of his presentation and others presented such a weak one that there is strong evidence that no time was spent on preparation. the proof lies with the manner of substance contained in the presentation itself and its delivery. yes, i am aware of the pressure placed on you for maintaining a high academic standard in your studies in program of your major. however, this does not invite you to be slack concerning this perquisite course of oral english. you require a specific mark in order to pass and obtain your degree from this course. i would conclude from your actions that you would be high school students rather than PH.D. students solely based on events for the past two weeks.
coming from canada to teach in this school was priviledge and anhonor especially being recommended by previous teachers, i deem it that each student is not satisfied with the curriculum of this class and its teacher, hence these events and troubled classroom atmosphere. thus i am willing to remove myself and norify the english department accordingly and you may continue your studies in oral english by yourself and user whatever means to improve your level and competency.
on the other hand, of the students of this class are willing to do their homework, do their presentation in a orderly manner which indicates that serious effort has taken place, i am more than willing to continue in this class with the format laid out in the syllabus. every effort will be extended by me to correct, instruct and introduce new vocabulary, and pronunciation in an oral setting. the choice rests with each student in this class. when you are serious… email me at [email protected] and i will return to this class. your time as well as mine is valuable and it is too precious to waste… …thank you!
借鉴VPN思想解决高层数据通信
问题:PC A,PC B,8541 C,8541,D
A和C以及B和D分别连接为局域网,C和D之间是空中借口,现在要在A-B之间进行网络通信(例如ftp)。之前用HOOK抓包再送到以太网卡上遇到的问题是因为A B的网络配置把彼此的IP地址配置到了同一个子网里面,因此会有arp查询包,需要在8541上做arp欺骗。只要把它们的网络设置为不同的网段,例如
A:192.168.0.1/255.255.255.0
B:192.168.1.1/255.255.255.0
C:192.168.0.2/255.255.255.0
D:192.168.1.2/255.255.255.0
并把C与D设置为网关,这样一来由A发往B的IP包会发到网关C上,在C上做Hook抓到,通过空中借口原样发到D上,D以网关的身份发给B。不需要做中继欺骗,相当于我们用空中借口实现了一个隧道。而且这样一来可以在一个片子上接多个MT,只要IP地址不冲突。
由此推想,通过VPN接入专有网络的机器的IP地址应该是不同于真实专有网络的IP网段,否则路有肯定会出错。