Moving the Origin (转)
Moving the Origin (转)[@more@] Moving the Origin By default, a device context's origin is in the upper left corner of the display surface. Even if you change the mapping mode, the origin remains in the upper left corner. But just as you can change the mapping mode, you can also move the origin. MFC's CDC class provides two functions for moving the origin. CDC::SetWindowOrg moves the window origin, and CDC::SetViewportOrg moves the viewport origin. You'll normally use one but not both. U
iczelion pe tut1 (转)
iczelion pe tut1 (转)[@more@] Tutorial 1: Overview of PE file format This is the complete rewrite of the old PE tutorial no1 which I considered the worst tutorial I have ever written. So I decided to replace it with this new one. PE stands for Portable Executable. It's the native file format of win32. Its specification is derived somewhat from the unix Coff (common object file format). The meaning of "portable executable" is that the file format is universal across win32 platform: the P
一条语句改变对话框背景和文本颜色 (转)
一条语句改变对话框背景和文本颜色 (转)[@more@] 作者:龚建伟 编程源码)、串口调试助手、端口网络通信技术,VC/C编程,移动机器人控制相关技术,Matlab仿真及数据处理 ">啸峰工作室 CLabel类可以有选择地改变 Static 静态文本颜色、背景,或将静态文本设置为超链接,但如果对话框全部改成其它统一的背景色和文字颜色,在VC中则只需一条语句。 首先下载我做的示例源程序bgtextcolor.ziip:.NET/FileBBS/files/2001_9/T_641_1.zip">下载(VC6.0,WIN9X/2000) ,在压缩包内我还放了个word文档的256颜色表,你选择
JDBC Connection Pool Example (转)
JDBC Connection Pool Example (转)[@more@] /* * Copyright (c) 1998 by Gefion software. * * PeRmission to use, copy, and distribute this software for * NON-COMMERCIAL purposes and without fee is hereby granted * provided that this copyright notice appears in all copies. * */ import Java.io.*;import java.sql.*;import java.util.*;import java.util.Date; /** * This class is a Singleton that provides access to one or many * connection pools defined
WIN2K下COM组件的反注册方法。 (转)
WIN2K下COM组件的反注册方法。 (转)[@more@] 大家在编写ASP或VB应用程序时经常会用到COM组件。但是组件的个数或版本写多了,机器上注册的组件就会非常混乱。有时甚至都不知道程序调用的是那个版本的组件。下面就向大家介绍几种可以彻底清除系统中已经注册的组件的方法。 一. 如何知道系统中有哪些组件已经被注册。 有两个办法: 1. 用windows的组件服务。 在Win2k的管理工具中打开组件服务。展开“我的电脑”,展开“COM+应用程序”,展开任意应用程序,在“组件”上右键,“新建组件”,“导入已被注册的组件”。在列
Dephi 程序输入法自动切换最简单最好用的实现方法(被程序员杂志采纳,重新详细整理) (转)
Dephi 程序输入法自动切换最简单最好用的实现方法(被程序员杂志采纳,重新详细整理) (转)[@more@] 前言: 当我们的软件交付用户使用时,特别涉及到大量的数据输入处理时,用户需要频繁的在中英文之间切换,而且用户使用的输入法也不同,有的是 五笔,有的是拼音等等.我们能否在软件中提供一个个性化的输入法选择?当用户选择自己喜欢的输入法时,程序中该输入中文的地方,全部自动切换为中文,该输入英文的地方自动切换为英文. 这个实现方法比较多,但多很麻烦,因此,虽然很多程序员可以实现,但都感到非常麻烦而放弃!下面是本人的一个非
对话框的菜单、控件使用COMMAND_UI (转)
对话框的菜单、控件使用COMMAND_UI (转)[@more@] 对话框的菜单和控件无法使用COMMAND_UI 下面方法最简单、最实用的实现了。 //CXxxDlg.h /////////////// //重载WM_MENUselectafx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu); //CXxxDlg.cpp /////////////// //消息映射ON_WM_MENUSELECT()//消息映射结束 void CXxxDlg::OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu) { //CDialog::OnMenuSelect(nItemID, nFlags, hSysMenu); CCmdUI cmdUI; CMenu* pMai
从面向对象到模式再到真正的面向对象 (转)
从面向对象到模式再到真正的面向对象 (转)[@more@]从面向对象到模式再到真正的面向对象 Alan Shalloway 著 透明 译 (译序: 本文摘自Design Patterns Explained: A New Perspective on object-Oriented Design一书的前言部分。通过本文,读者可以大概了解学习设计模式的过程和效果。同时,作者谦虚谨慎的态度也是非常值得我们中国软件开发者学习的。 Mailto:译者保留本文一切权利。如果需要将本文用于非营利性目的,请E-mail通知我:gigix@263.NET">译者保留本文一切权利。如果需要将本文用于非营利性
The Brush Origin (转)
The Brush Origin (转)[@more@] The Brush Origin One attribute of a device context that you should be aware of when using dithered brush colors or hatch brushes is the brush origin. When windows fills an area with a hatched or dithered brush pattern, it tiles an 8-pixel by 8-pixel pattern horizontally and vertically within the affected area. By default, the origin for this pattern, better known as the brush origin, is the device point (0,0)—the screen pixel in the upper left corner of th
用VC编出来的东东到别的机器上运行不了? (转)
用VC编出来的东东到别的机器上运行不了? (转)[@more@]经常看见有人提出自己用vc编出来的东西到别的机器上运行不了,我也遇过这样的问题,其实这一般是初学者都会遇到的问题,因为入门的书都不会太全面,所以好多譬如这样的问题是难以解决的。我总结经验如下: 其实一般在编程序时,都是生成了调试版的程序,就是在那个Debug目录下的可执行文件。运行这调试版的exe文件,都会动态连接MFC42D.DLL和MSVCRTD.DLL这两个文件,所以你如果将这个文件在其它机器上运行而这台机器没有这两个文件或者缺少一个,系统则会出现:“找不到所需.dl
MFC Application---The Frame Window Object (转)
MFC Application---The Frame Window Object (转)[@more@] The Frame Window object MFC's CWnd class and its derivatives provide object-oriented interfaces to the window or windows an application creates. Hello's window class, CMainWindow, is derived from MFC's CFrameWnd class, which is derived from CWnd. CFrameWnd models the behavior of frame windows. For now, you can think of a frame window as a top-level window that serves as an application's primary interface to the outside world. In the
从对web services的支持来比较J2EE和.NET (转)
从对web services的支持来比较J2EE和.NET (转)[@more@] I. Preface In this whitepaper, we will make a powerful comparison between the two choices that businesses have for building XML-based web services: the Java 2 Platform, Enterprise Edition (J2EE)1 , built by Sun Microsystems and other industry players, and microsoft.NET2, built by Microsoft Corporation. Some of the statements we make will offend you, and hopefully more of them will agree with you. So as you read this paper, plea
我用VJ基本完成了一个四国象棋网络程序,因时间关系,不能继续,谁帮我完成? (转)
我用VJ基本完成了一个四国象棋网络程序,因时间关系,不能继续,谁帮我完成? (转)[@more@]我用VJ基本完成了一个四国象棋网络游戏程序,因时间关系,不能继续,谁帮我完成? 四国象棋下棋规则: 1.各子功能不变; 2.车、炮只能沿直线或弧线行走,不可走折线; 3.以下情况视为“日”字,具体说明见下图: ① --②, ③-- ④。蹩腿的情况:从 ①跳至②,有 ③则 蹩腿;从②跳至①,有 ⑤则蹩腿;③从跳至④,有⑤则蹩腿;④从跳至③,有②则蹩腿。 4.对家一队,顺对针行走,吃掉对方两个将(帅)为胜; 5.一家死后,其子留在棋盘上不动,任何
MFC Application (转)
MFC Application (转)[@more@]Your First MFC Application It's time to build your first MFC application. And what better place to start than with one that displays "Hello, MFC" in a window? Based on the classic "Hello, world" program immortalized in Brian Kernighan and Dennis Ritchie's The C Programming Language (1988, Prentice-Hall), this very minimal program, which I'll call Hello, demonstrates the fundamental principles involved in using MFC to write a windows application. Among other things, y
一个程序员的千年决心 (转)
一个程序员的千年决心 (转)[@more@]文章比较长,希望你能耐心读完, 相信对你会有帮助。 在2000 年1 月1 号的零点。不管在1 999 如何如何,依然有电,水还在流,世界上的金融系统仍在加加减减的正常运行。这已经是新千年的开始,但你仍要作些新年誓言。是的,你可以发誓减肥或是更多的在外工作,但你是否可以持续一到两周?不如作些承诺改进做为软件专业人士的职业生涯吧。请仔细想想以下的一些决定: 我不妨碍他人。你不应只想玩玩,就使用技术。你用技术,因为这合情合理,或对解决在手边的问题有用。许多开发者仅仅为了获取经验而建
区分引用类型和原始类型 (转)
区分引用类型和原始类型 (转)[@more@]Java 提供两种不同的类型:引用类型和原始类型(或内置类型)。另外,Java 还为每个原始类型提供了封装类(Wrapper)。如果需要一个整型变量,是使用基本的 int 型呢,还是使用 Integer 类的一个对象呢?如果需要声明一个布尔类型,是使用基本的 boolean,还是使用 Boolean 类的一个对象呢?本文可帮助您作出决定。 下表列出了原始类型以及它们的对象封装类。 原始类型和封装类 原始类型 封装类boolean Boolean char Character byte Byte short Short int Integer long Long float Float double
在运行时刻更新功能模块 (转)
在运行时刻更新功能模块 (转)[@more@]本文介绍了一个利用类库加载器ClaSSLoader 实现在运行时刻更新部分功能模块的Java程序,并将其与C/C++中实现同样功能的动态链接库方案进行了简单比较。 介绍 在嵌入式系统的设计中,经常涉及到在运行时刻更新部分功能模块的设计。例如一个用于数据采集与处理的设备,包括数据采集,数据发送,命令接收等功能模块,有可能被要求在继续进行数据采集的同时采用新的数据格式向一个新的数据处理系统发送数据。在这种情况下,就必须在运行时刻动态的更新数据发送的功能模块。 在C/C++中,这样的功能可以很
快捷键(Delphi 5)---Enterprise (转)
快捷键(Delphi 5)---Enterprise (转)[@more@] 快捷键: XML:namespace prefix = o ns = "urn:schemas-microsoft-com:Office:office" /> F11 ------------------------------------ 显示对象监视器(object Inspector) F12 ------------------------------------ 在窗体(Form)与程序代码编辑器(Code Editor)之间转换 Ctrl + F12 ------------------------------ 显示程序单元列表 Shift + F12 ----------------------------- 显示窗体列表 Ctrl +
iczelion tut30 (转)
iczelion tut30 (转)[@more@]第30课: win32调试api 第三部分 在本章中,我们将继续探讨win32调试api。特别地,我们将学习如何去跟踪被调试程序. 理论: 如果你以前使用过调试器,那么你应对跟踪比较熟悉。当"跟踪"一个程序时,程序在每执行一条指令后将会停止,这使你有机会去检查寄存器/内存中的值。这种单步运行的官方定义为跟踪(tracing)。单步运行的特色是由cpu本身提供的。标志寄存器的第8位称为陷阱标志trap flag。如果该位设置,则CPU运行于单步模式。CPU将在每条指令后产生一个debug异常。当debug 异常产生后,陷阱标志自动
Introducing MFC (转)
Introducing MFC (转)[@more@]Introducing MFC MFC is the C++ class library microsoft provides to place an object-oriented wrapper around the windows api. Version 6 contains about 200 classes, some of which you'll use directly and others of which will serve primarily as base classes for classes of your own. Some MFC classes are exceedingly simple, such as the CPoint class that represents a point (a location defined by x and y coordinates). Others are more complex, such as the CWnd class that encap