2009年7月25日

Adapter 模式(对象适配器模式)

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Adapter{ public interface INewLog { void WriteLog(); } public interface IOldLog { void Write(); } class File... 阅读全文

posted @ 2009-07-25 14:01 Acor 阅读(175) 评论(0) 推荐(0) 编辑

State 模式

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;//work : 变量 time, bfinished, state, //work : 方法 WriteProgram, SetState, //state: 方法 WriteProgram(work w)namespace stat... 阅读全文

posted @ 2009-07-25 13:57 Acor 阅读(153) 评论(0) 推荐(0) 编辑

2009年7月23日

AbstractFactory 模式

摘要: //问题描述:操作数据库。数据库可能是Access、SQL等。以操作用户信息、部门信息为例。//可能在任意数据库中操作。//User类;Department类; IUser,UserOperAccess,UserOperSQL;//IDep,DepOperAccess,DepOperSQL;//DataAccess:创建出操作类型//通过配置文件来管理(通过反射机制动态加载)要创建的操作类型。us... 阅读全文

posted @ 2009-07-23 08:55 Acor 阅读(153) 评论(0) 推荐(0) 编辑

2009年7月19日

vc6 和 vs2008 的问题

摘要: 问题描述:vc 6 下Cstring 字符串无法查看变量值;vs 2008下可以。vc 6 函数语法检查似乎更为严格;vc 6下参数类型不对,不能得到正确结果;vs 2008下传Cstring 可以得到正确结果,且不会有异常。CStdioFile::WriteStringvirtual void WriteString( LPCTSTR lpsz );CFile::Open virtual BOO... 阅读全文

posted @ 2009-07-19 10:36 Acor 阅读(330) 评论(0) 推荐(0) 编辑

2009年7月15日

shellapi.h error C2065: “HDROP”: 未声明的标识符,编译出无数错误,都是这个头文件的错误

摘要: solution:#include "windows.h " // 前面加上这个 #include "shellapi.h " 阅读全文

posted @ 2009-07-15 09:50 Acor 阅读(1435) 评论(0) 推荐(0) 编辑

2009年7月13日

Proxy 模式

摘要: namespace ProxyPursuit{ class Beauty { private string name; public string BeautyName { get; set; } public Beauty() { } public Beauty(string name2) { this.name = name2; } } interface GiveGift { void Gi... 阅读全文

posted @ 2009-07-13 21:10 Acor 阅读(228) 评论(0) 推荐(0) 编辑

nafxcw.lib(afxmem.obj): LNK 2005 错误:"void * _cdecl 运算符 new (unsigned int)"(stdafx.obj 中已定义 2@YAPAXI@Z)

摘要: http://support.microsoft.com/kb/184235解决方案:删除 _ ATL _ MIN _ CRT 预处理器定义,并重建该项目。 为此,请在 项目 菜单上单击 设置 。 在 C/C++ 选项卡上选择 预处理器 类别,并删除 _ ATL _ MIN _ CRT 定义。 阅读全文

posted @ 2009-07-13 13:26 Acor 阅读(1361) 评论(0) 推荐(0) 编辑

2009年7月11日

Decorate模式 组合

摘要: 装饰:修饰Class Person //人有名字和形象。一个人逐渐发展,形象不断完善,如何避免多重继承?Class PersonWrapper:Person //包装类,对人进行修饰,专门用于扩展包装//他可能硬汉,可能柔情,可能博学,可能多金...也可能既硬汉柔情,又博学多金...(完美的化身)class PersonYingHan:PersonWrapper //硬汉包装类class Pers... 阅读全文

posted @ 2009-07-11 14:40 Acor 阅读(432) 评论(0) 推荐(0) 编辑

Strategy 模式

摘要: 目录:AbstractPunish.cs;//抽象策略类Context.cs;//管理类LaJiaoShui.cs;//具体策略类LaoHuDeng.cs;//具体策略类XiaZhuQian.cs;//具体策略类Program.cs.//客户端类//AbstractPunish.cs;namespace StrategyPunish{ abstract class Punish { public ... 阅读全文

posted @ 2009-07-11 13:20 Acor 阅读(252) 评论(0) 推荐(0) 编辑

2009年7月8日

error LNK2001

摘要: Searching for 'PathFileExists'...F:\ElecRoc2\SourceCode\PJTP\ColorPrnParam\ParamSet.cpp(959):if (!name.IsEmpty() && PathFileExists(name))F:\ElecRoc2\SourceCode\PJTP\ColorPrnParam\ParamSet.cpp(... 阅读全文

posted @ 2009-07-08 15:14 Acor 阅读(606) 评论(0) 推荐(0) 编辑

导航