摘要: #pragmaonce#include<boost/asio.hpp>#include<boost/bind.hpp>#include<boost/shared_ptr.hpp>usingboost::asio::ip::tcp;classCAsioClient{public:CAsioClient(boost::asio::io_service&io_service,tcp::endpoint&endpoint):socket(io_service){socket.async_connect(endpoint,boost::bind(&am 阅读全文
posted @ 2011-07-04 18:03 kenter 阅读(1098) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Reflection;namespaceTestXtraGridAutoBind{publicpartialclassForm1:Form{publicUser[]userArr;publicIList<UserObj>user 阅读全文
posted @ 2011-05-22 22:56 kenter 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 通过char*作为中介. CString->std::string 例子: CString strMfc=“test“; std::string strStl; strStl=strMfc.GetBuffer(0); std::string->CString 例子: CString strMfc; std::string strStl=“test“; strMfc=strStl.c_str(); 阅读全文
posted @ 2011-04-27 15:38 kenter 阅读(2097) 评论(1) 推荐(0) 编辑
摘要: publicabstractclassAbstractThread{Threadthread=null;publicabstractvoidrun();publicvoidstart(){if(thread==null)thread=newThread(newThreadStart(run));thread.Start();}}publicdelegatevoidTimeEventHandler(objectobj,TimeEventArgsargs);publicclassEventThread:AbstractThread{publicEventThread(){IsAlive=true; 阅读全文
posted @ 2011-04-26 23:00 kenter 阅读(138) 评论(0) 推荐(0) 编辑
摘要: WindowsRegistryEditorVersion5.00[HKEY_CLASSES_ROOT\folder\shell\cmd]@="CMD快速通道"[HKEY_CLASSES_ROOT\folder\shell\cmd\command]@="cmd.exe/kcd%1" 阅读全文
posted @ 2011-04-21 21:27 kenter 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 动态链接库技术使软件工程师们兽血沸腾,它使得应用系统(程序)可以以二进制模块的形式灵活地组建起来。比起源码级别的模块化,二进制级别的模块划分使得各模块更加独立,各模块可以分别编译和链接,模块的升级不会引起其它模块和主程序的重新编译,这点对于大系统的构建来说更加实用。另一方面,对于商业目的明显的企业,各模块可以独立设置访问权限,开发成员只能访问自己负责的模块,其它模块是不能也不给看到的,这样减少了整个系统泄漏技术的风险。一、动态链接库技术概况 动态链接库技术用得很多。事实上,整个Windows就是由一个个动态链接库(DLL)构建起来的,不管是系统内核,或是系统调用的API封装,还是通用工具(如控 阅读全文
posted @ 2011-04-19 21:24 kenter 阅读(664) 评论(0) 推荐(2) 编辑
摘要: publicclassDoubleBufferListView:ListView{publicDoubleBufferListView(){SetStyle(ControlStyles.DoubleBuffer|ControlStyles.OptimizedDoubleBuffer|ControlStyles.AllPaintingInWmPaint,true);UpdateStyles();}}usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem. 阅读全文
posted @ 2011-04-18 21:38 kenter 阅读(546) 评论(0) 推荐(0) 编辑
摘要: ICE3.4.1试用手记(kenter原创)由于项目中服务端用的是C++,客户端是C#。想用一些比较方便而效率也不低的中间件。看了下文章介绍ICE http://www.zeroc.com/ice.html相关下载 http://www.zeroc.com/download.html安装 Ice-3.4.1.msi 后,设置系统变量加入bin目录 以便试用slice命令根据ICE统一接口语言生成相应的文件例如我试用VS 2010 配置VC++包含目录,库目录等等包含目录加入$(SolutionDir)在C/C++项里的“运行时库”为多线程DLL(/MD),否则在编译时会出预编译错误:预编译头选 阅读全文
posted @ 2011-04-09 14:00 kenter 阅读(848) 评论(0) 推荐(0) 编辑
摘要: 在.net中有了一个AppDomain——应用程序域的新概念,.NET程序通过AppDomain这个媒介来运行在进程中。 我们运行一个.NET应用程序或者一个运行库宿主时,OS会首先建立一个进程,然后会在进程中加载CLR(这个加载一般是通过调用_CorExeMain或者_CorBindToRuntimeEx方法来实现),在加载CLR时会创建一个默认的AppDomain,它是CLR的运行单元,程序的Main方法就是在这里执行,这个默认的AppDomain是唯一且不能被卸载的,当该进程消灭时,默认AppDomain才会随之消失。 一个进程中可以有多个AppDomain,且它们直接是相互隔离的,我. 阅读全文
posted @ 2011-04-02 20:30 kenter 阅读(2246) 评论(3) 推荐(0) 编辑
摘要: structitemEx{publicobjectValue;publicstringText;publicitemEx(objectvalue,stringtext){this.Value=value;this.Text=text;}//重点是overrideToStringpublicoverridestringToString(){returnText;}}ComboBoxItemCollectioncoll=comboBoxEdit1.Properties.Items;coll.BeginUpdate();try{coll.Add(newitemEx("Sven", 阅读全文
posted @ 2011-03-27 12:17 kenter 阅读(534) 评论(0) 推荐(0) 编辑