- 博客(38)
- 资源 (14)
- 收藏
- 关注
原创 C++良好的代码风格
1, 命名,简单就是美,简单易记,望文生义,并且风格要保持一致。 2, 注释 3, 合理的缩进和版面布局 4, 遵守基本的编程约定。 5, 功能分类的函数等分类好。
2010-05-07 17:17:00
865
原创 ACE调试信息的输出
/**00470 * Format a message to the thread-safe ACE logging mechanism. Valid00471 * options (prefixed by %, as in printf format strings) include:00472 * - A: p
2010-01-30 09:55:00
802
原创 几个关于文件路径方面的函数,不断更新...
PathStripToRoot 得到该路径的根目录 Removes all parts of the path except for the root information. SyntaxBOOL PathStripToRoot( LPTSTR szRoot);ParametersszRoot[in,
2009-12-02 16:39:00
1205
原创 cin EOF Linux
我为什么写这个题目呢,因为我今天要写的博与这三者都有关系,至少我个人认为是这样的。有个人问了一个这样的小程序,说有问题:#include #include #include using namespace std;int main(){ vector spvec; string str; cout <<"input string" <<endl;
2009-11-25 15:15:00
1346
转载 网络是否连接?
IsNetworkAlive FunctionIsNetworkAlive Function The IsNetworkAlive function determines whether or not a local system is connected to a network, and identifies the type
2009-11-24 11:43:00
1105
转载 vim 中使用多个文件
辛辛苦苦写了这么久,不小心按了一下什么,把firefox关了。所有东西不见了,再也不想写了,抄一个来吧。 其实自己查看帮助也行,在vim的命令模式下输入: help tabnew 下面的是抄的,与帮助里面说的差不多,我基本都试过了。 from: http://blog.youkuaiyun.com/timke212004/ar
2009-11-23 15:45:00
920
原创 几个关于语言和区域的函数
GetUserDefaultUILanguageThis function retrieves the language identifier (LANGID) for the current users UI language selection.http://msdn.microsoft.com/en-us/library/aa913797.aspx Set
2009-11-20 17:26:00
955
原创 阻止Windows注消 (log off or logging off)
先看下MSDN http://msdn.microsoft.com/en-us/library/aa376876%28VS.85%29.aspx 示例代码: LRESULT CLangTestDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam){ if(message==WM_QUERYENDS
2009-11-13 16:35:00
2107
原创 SHBrowseForFolder 上的network不能展开???
关于SHBrowseForFolder的使用麻烦翻看我前面所写的博文。 但后来我改了什么我倒不知道,只是那样在win7下NetWork是不能展开看到文件夹的,但是奇怪的是XP可以。我找了半天,后面发现别人的一个例子可以做到,我的不可以,但他的与我所写的基本一样,这样我就晕了,难道是我的设置错误吧。 找了一下,果然,我错误的代码是这样的: BROWSEINFO bi;// ...
2009-11-09 16:19:00
877
翻译 CreateNamedPipe
// Click Start Client to start the NamedPipe Clientvoid CDlgTestDlg::OnBnClickedOk(){ CString szPipeName; szPipeName.Format(_T("////%s//pipe//%s"),_T("."),_T("HelloWorld")); HANDLE hP
2009-11-09 13:59:00
6860
翻译 VC++ 创建管道
void CDlgTestDlg::OnBnClickedOk(){ SECURITY_ATTRIBUTES sa; HANDLE hRead,hWrite; sa.nLength=sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle=TRUE; if(!CreatePipe(&hRead,&hWrite,&sa,0))
2009-11-05 16:49:00
1970
原创 SHGetSpecialFolderLocation 的使用方法
详情,请查看MSDN:http://msdn.microsoft.com/en-us/library/bb762203%28VS.85%29.aspx 这里只提供一小段代码: void CDlgTestDlg::OnBnClickedOk(){ LPITEMIDLIST pidl; TCHAR szPath [MAX_PATH]; if(SUCCEEDED( S
2009-10-29 17:39:00
4176
原创 SHBrowseForFolder的使用,获取其中一个button的ID
关于其他方面的东西,可以参考上一篇:http://blog.youkuaiyun.com/HelloDan/archive/2009/10/26/4729693.aspx HWND hChild=GetWindow(hwnd, GW_CHILD); while(hChild) { GetWindowText(hChild,szWindo
2009-10-29 15:44:00
951
原创 SHBrowseForFolder 的一些使用
SHBrowseForFolder是一个可以用于获取文件夹路径的Windows API。使用起来可以方便很多,近来在写程序时用到了,现在总结一下。 首先当然要有一些基本认识才行。所以先看一下下面所列的MSDN。http://msdn.microsoft.com/en-us/library/bb762115%28VS.85%29.aspxhttp://msdn.micr
2009-10-26 16:07:00
5158
2
转载 VS2008 中无法使用ACTIVEX控件的解决
转]VS2008 中无法使用ACTIVEX控件的解决如果你在打开对话框时弹出 "The ActiveX control "Grid Control" could not be instantiated because it requires a design-time license"这个对话框时,在VC安装盘中找到vb6controls.reg,双击导入注册表就OK了,没有这个文件的
2009-10-08 01:03:00
2907
转载 CallBack function from Pointers on C
#includetypedef struct ode{ int value; struct Node *link;}Node;/*Call back function, its useful for different kind of node, we just want to change compare function*/Node* getnode(
2009-09-18 01:38:00
627
原创 写程序都会遇到的问题, DPI
http://msdn.microsoft.com/en-us/library/dd464659%28VS.85%29.aspx http://msdn.microsoft.com/en-us/library/dd464660%28VS.85%29.aspx
2009-09-09 14:12:00
642
原创 C++相关的信息。。。
http://www.research.att.com/~bs/bs_faq2.html#vcall 里面有C++作者关于C++的一切信息。
2009-08-25 17:09:00
695
原创 C/C++ 头文件相对位置的包含
对于多个的C/C++头文件的包含,一般情况下放在工程的目录下编译器就可以正确地找到。 但是对于在不同文件夹下的头文件的包含,当然可以写完整的路径,但是这样有可能会出现将工程拷到别人的机子上运行不了的问题。如果在这个程里同写上相对的路径,那么不仅在自己的机子上能运行,别人拷了过去也能正确运行。 例如我的一个工程头文件如下: c:/F/Work/test/te
2009-08-24 11:27:00
7144
1
转载 Nested Dialogs 嵌套对话框
The Windows Common Dialogs<!-- <!-- function fullSize(sURL){window.open(sURL,scrshot,width=500,height=375,top=20,left=20,directories=no , Toolbar = no, resizable = yes, menubar = no, ScrollBa
2009-08-10 16:58:00
784
翻译 modeless dialog.
First of all, I must announce that the main ideas of this paper are from Programming Microsoft Visual C++ Fifth Edition. In order to demostrate the modeless dialog. Here I take the followi
2009-08-10 15:02:00
952
转载 transparent CStatic
// Method 1:class CTransparentStatic : public CStatic{ DECLARE_DYNAMIC(CTransparentStatic)public: CTransparentStatic(); virtual ~CTransparentStatic();protected: afx_msg LRESULT OnSet
2009-08-05 11:16:00
1615
转载 setjmp()/longjmp()
setjmp()/longjmp()Setjmp() and longjmp() are subroutines that let you perform complex flow-of-control in C/Unix. One of the keys to understanding setjmp() andlongjmp() is to under
2009-07-21 09:41:00
998
原创 ActiveX in Visual studio 2008
近来看书看到了ActiveX,由于环境换成了Visual studio 2008,找了半天没有找到ActiveX Test container,到网上找了一下才发现ActiveX Test container in Visual studio 2008是要自己编译的,下面是MS所介绍的。 http://msdn.microsoft.com/en-us/library/f9adb5t5
2009-06-25 22:24:00
1437
原创 stdarg Macro 关于可变参数
#includestdio.h>#includestdarg.h>double average(int val,...)...{ va_list var_arg; int count; double sum=0.0; /** *//**prepare to visit variable arguments**/ va_start(var_arg,val); /** *//
2008-03-04 01:48:00
828
原创 Iterator
#include iterator> #include numeric> #include deque> #include iostream> using std::deque; using std::cout; using std::ostream_iterator; using std::endl; int main () ...{ // // Initialize a
2008-01-06 03:50:00
198
原创 整理的C++ primer TextQuery 例题
/**/////// TextQuery.cpp/**//* * This file contains code from "C++ Primer, Fourth Edition", by Stanley B. * Lippman, Jose Lajoie, and Barbara E. Moo, and is covered under the * copyright and warra
2008-01-05 01:41:00
1457
原创 C++ primer English Fourth edition page 349 exercises
/**//* C++ primer English Fourth editionpage 349 exercise 9.40*/#includestring>#includeiostream>using namespace std;int main()...{ string q1("When lilacs last in the dooryard bloomd"); string q2(
2007-12-25 01:16:00
710
原创 C++ primer english fourth edition page330
#includeiostream> //#include#includelist>#includevector>using namespace std; int main() ...{ listchar*> clist(5,"Hello Dan"); vectorstring> svec(7,"HelloWord"); svec.assign(clist.begin(),clis
2007-12-22 02:29:00
820
原创 A Error in C++ primer English Fourth edition
#includeiostream> #includevector>using namespace std; int main() ...{ vectorint> vec(10,12); for(vectorint>::iterator iter=vec.begin();iter!=vec.end();++iter) coutiter" "; coutendl;
2007-12-22 01:31:00
621
原创 C++ primer English Fourth edition P322 Exercise 9.18
#includeiostream>#includevector>#includelist>#includealgorithm>using namespace std;/**//*// The procedure to compare a vector and a list is find if they are equal.bool compare(const vector &vec,c
2007-12-21 00:53:00
858
原创 using switch case block not just under the integral type
#includeiostream> #includestring> #includemap>using namespace std;int main() ...{ mapstring,int> strint; strint.insert(make_pair("Banana",1)); strint["Apple"]=2; strint.insert(maps
2007-12-17 00:56:00
800
原创 Assembly language experiment----Encryption
Title Encryption program;-----------------------------------------------------------;Discription: TO encrypt data from a file.;Author: Dan Lee, Sun Yat-sen University All rights reserved;----------
2007-12-16 01:19:00
855
原创 Insert sort
#includeiostream>using namespace std;templatetypename type>void insert_sort(type *arr,long num)...{ long i(0),j(0); type key; for(j=1;jnum;++j) ...{ key=*(arr+j); i=j-1; while(i>=0 && *
2007-12-16 00:35:00
795
原创 C++ primer English fourth edition exercise page 301
C++ primer fourth edition page301Write a program to store each line from a file in a vector. Now use an istringstream to read each line from the vector a word at a time.#includeiostream>#in
2007-12-15 01:45:00
599
原创 C++的sstream标准库介绍
From:http://www.cppblog.com/tommyyan/archive/2006/08/18/8023.html接下来我们继续看一下C++风格的串流控制,C++引入了ostringstream、istringstream、stringstream这三个类,要使用他们创建对象就必须包含sstream.h头文件。 istringstream类用于执行C++风格的串流
2007-12-12 14:19:00
1316
原创 好多东西不会
发现自己好多东西不会。现在又没时间学,晕啊~真后悔以前不努力,不早点遇到优快云今天看到了论坛的人在讨论荷兰国旗问题,好想编一下,但又没时间。等过了一月吧。我专心学编程。还有今天收藏了一个关于缓冲区的帖,在输入输出方面我个人还有很多不懂,到时再看。这里是提醒自己。
2007-12-08 01:30:00
1083
2
转载 c++ ios::app and ios::ate
First lets assure, that I understand what you want to do: You want to open an existing file, append some data, then go back to the position where you started to append and write some other data at
2007-12-06 13:21:00
5599
Programming Microsoft Visual C++ Fifth Edition 代码
2009-06-30
Programming Microsoft Visual C++ Fifth Edition
2009-06-30
Programming windows with MFC的一个例子
2009-05-22
Thinning methodologies-a comprehensive survey
2009-04-16
Deformation Models for Image Recognition
2009-04-16
Qt写的遗传算法加画图程序
2009-04-04
约瑟夫(Joeph)问题CC++解法
2009-03-17
简单遗传算法C语言代码
2007-05-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人