![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
文章平均质量分 58
HelloDan
这个作者很懒,什么都没留下…
展开
-
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 · 5530 阅读 · 0 评论 -
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 · 590 阅读 · 0 评论 -
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 · 2856 阅读 · 0 评论 -
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 · 5062 阅读 · 2 评论 -
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 · 1914 阅读 · 0 评论 -
SHBrowseForFolder的使用,获取其中一个button的ID
关于其他方面的东西,可以参考上一篇:http://blog.csdn.net/HelloDan/archive/2009/10/26/4729693.aspx HWND hChild=GetWindow(hwnd, GW_CHILD); while(hChild) { GetWindowText(hChild,szWindo原创 2009-10-29 15:44:00 · 916 阅读 · 0 评论 -
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 · 4112 阅读 · 0 评论 -
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 · 6723 阅读 · 0 评论 -
SHBrowseForFolder 上的network不能展开???
关于SHBrowseForFolder的使用麻烦翻看我前面所写的博文。 但后来我改了什么我倒不知道,只是那样在win7下NetWork是不能展开看到文件夹的,但是奇怪的是XP可以。我找了半天,后面发现别人的一个例子可以做到,我的不可以,但他的与我所写的基本一样,这样我就晕了,难道是我的设置错误吧。 找了一下,果然,我错误的代码是这样的: BROWSEINFO bi;// ...原创 2009-11-09 16:19:00 · 838 阅读 · 0 评论 -
阻止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 · 2028 阅读 · 0 评论 -
几个关于语言和区域的函数
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 · 899 阅读 · 0 评论 -
网络是否连接?
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 · 1064 阅读 · 0 评论 -
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 · 1299 阅读 · 0 评论 -
写程序都会遇到的问题, 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 · 601 阅读 · 0 评论 -
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 · 1390 阅读 · 0 评论 -
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 · 770 阅读 · 0 评论 -
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 · 589 阅读 · 0 评论 -
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 · 808 阅读 · 0 评论 -
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 · 781 阅读 · 0 评论 -
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 · 634 阅读 · 0 评论 -
整理的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 · 1410 阅读 · 0 评论 -
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 · 145 阅读 · 0 评论 -
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 · 958 阅读 · 0 评论 -
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 · 1570 阅读 · 0 评论 -
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 · 907 阅读 · 0 评论 -
C/C++ 头文件相对位置的包含
对于多个的C/C++头文件的包含,一般情况下放在工程的目录下编译器就可以正确地找到。 但是对于在不同文件夹下的头文件的包含,当然可以写完整的路径,但是这样有可能会出现将工程拷到别人的机子上运行不了的问题。如果在这个程里同写上相对的路径,那么不仅在自己的机子上能运行,别人拷了过去也能正确运行。 例如我的一个工程头文件如下: c:/F/Work/test/te原创 2009-08-24 11:27:00 · 6970 阅读 · 2 评论 -
C++相关的信息。。。
http://www.research.att.com/~bs/bs_faq2.html#vcall 里面有C++作者关于C++的一切信息。原创 2009-08-25 17:09:00 · 652 阅读 · 0 评论 -
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 · 753 阅读 · 0 评论