随笔分类 - 00.C/C++
摘要:from:http://www.yolinux.com/TUTORIALS/CppStlMultiMap.html#include <string.h>#include <iostream>#include <map>#include <utility>using namespace std;struct cmp_str { bool operator()(char const *a, char const *b) { return std::strcmp(a, b) < 0; }};int main(){ map<char *, i
阅读全文
摘要:#include <iostream>using namespace std;int main(){ int i=10; int j=20; int * const cp = &i; cout<<*cp<<endl; (*cp)++; //ok: Can modify the variable pointed cout<<*cp<<endl; //cp = &j; //error: Canot modify a const object const int * pc ; pc = &i; cout<<
阅读全文
摘要:http://edn.embarcadero.com/article/20633Borland C++ Compiler version 5.5 Free Download Is Here !!!By:David IntersimoneAbstract: The free download version of the Borland C++ Compiler version 5.5 is now available.Borland C++ Compiler version 5.5 Free Download - AVAILABLE NOWOur classic ANSI C/C++ comp
阅读全文
摘要://Main.cpp#include <iostream>using namespace std;extern "C" int DoubleIt(int n);int main(){ cout<<"Value return by Double It is:" <<DoubleIt(2)<<endl; return 0;}.586.model flat,C.codeDoubleIt PROC,inval:DWORD mov eax,inval add eax,eax add eax,eax retDouble
阅读全文
摘要:objects = main.o kbd.o command.o display.o \insert.o search.o files.o utils.oedit : $(objects) cc -o edit $(objects)$(objects) : defs.hkbd.o command.o files.o : command.hdisplay.o insert.o search.o files.o : buffer.h.PHONY : cleanclean :rm edit $(objects)########################end##################
阅读全文
摘要:官方文档:http://www.gnu.org/software/make/manual/make.html简单示例:http://mrbook.org/tutorials/make/Compiling your source code files can be tedious, specially when you want to include several source files and have to type the compiling command everytime you want to do it.Well, I have news for you... Your da
阅读全文
摘要:from: http://cx4a.org/software/gccsense/manual.html#Editros1. Introduction1.1. What is GCCSense ?GCCSense is the most intelligent development tools for C/C++ using GCC's code analyzers. Using internal compiler information, it is capable to provide a high precise code completion functions. GCCSen
阅读全文
摘要:from:http://en.wikipedia.org/wiki/GNU_toolchainTheGNU toolchainis a blanket term for a collection ofprogramming toolsproduced by theGNU Project. These tools form atoolchain(suite of tools used in a serial manner) used for developingapplicationsandoperating systems.The GNU toolchain plays a vital rol
阅读全文
摘要:http://www.dwheeler.com/autotools/Try to use autotools, and after that gmake looks like child's play SCons vs. CMake The GNU build system, also known as the Autotools, is a suite of programming tools designed to assist in making source-code packages portable to many Unix-like systems.It can be d
阅读全文
摘要:#include <iostream>using namespace std;class Point{public: Point(int cx,int cy):x(cx),y(cy){ pData=new int; *pData = 0; } Point(const Point& pt) //copy constructor { x=pt.getX(); this->y=pt.getY(); pData=new int; *pData=pt.getData(); } voi...
阅读全文
摘要:在WINNT.H中有这样一段代码:#define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name#define sabc(val) #val#define glue(a,b) a##b#define MY_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *namestruct HTYPE2__ {int unused;}; typedef struct HTYPE2__
阅读全文
摘要:// Hook.cpp : Defines the entry point for the DLL application.//#include "stdafx.h"#include "Hook.h"HHOOK g_hHook;HHOOK g_hHookKey;HINSTANCE g_hIns;#pragma data_seg("MySeg")HWND g_hWnd =NULL;#pragma data_seg()//#pragma comment(linker,"/section:MySeg,RWS")BOOL
阅读全文
摘要:// The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the HOOK_EXPORTS// symbol defined on the command line. this symbol should not be defined on any project// that uses this DLL. This way any other
阅读全文
摘要:// InnerHookDlg.cpp : implementation file//#include "stdafx.h"#include "InnerHook.h"#include "InnerHookDlg.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif//////////////////////////////////////////////////////////////////////
阅读全文
摘要://filename : Dll1.h#ifndef _DLL1_H_ #define _DLL1_H_#ifdef DLL1_API#else#define DLL1_API extern "C" _declspec(dllimport)#endif // DLL1_APIDLL1_API int _stdcall add(int a,int b);DLL1_API int _stdcall substract(int a,int b);#endif //filename:Dll1.cpp#define DLL1_API extern "C" _dec
阅读全文
摘要:http://files.cnblogs.com/wucg/ActiveX_Demo_Clock.zip一个典型的ActiveX控件需要提供三种特性:属性、方法和事件。
阅读全文
摘要:邮槽是基于广播通信体系设计出来的,它彩用无连接的不可靠的数据传输。邮槽是一种单向通信机制,创建邮槽的服务器进程读取数据,打开邮槽的客户机进程写入数据。// MailslotSvrView.cpp : implementation of the CMailslotSvrView class//#include "stdafx.h"#include "MailslotSvr.h"#include "MailslotSvrDoc.h"#include "MailslotSvrView.h"#ifdef _DEBUG#de
阅读全文
摘要:// TestClipboardDlg.cpp : implementation file//#include "stdafx.h"#include "TestClipboard.h"#include "TestClipboardDlg.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif//////////////////////////////////////////////////////////
阅读全文
摘要:HANDLE hMutex;int main(){ hMutex = CreateMutex(NULL,TRUE,TEXT("tickets")); if(hMutex){ if(GetLastError()== ERROR_ALREADY_EXISTS){ cout<<"已存在运行实例"<<endl; system("pause"); return 0; } } 互斥对象(Mutex)、事件对象(Event) 与 关键代码段(CriticalSection) 的比较1.互斥对象和事件对象都属于内核对象,利用内
阅读全文
摘要:为了实现线程间的同步,不应该使用人工重置的事件对象,而应该使用自动重置的事件对象。g_hEvent = CreateEvent(NULL,FALSE,TRUE,NULL);注意区分人工重置事件对象和自动重置事件对象。当人工重置的事件对象得到通知时,等待该事件对象的所有线程均变为可调度线程,操作系统不会将该事件对象设置为无信息状态,需要显式地调用ResetEvent函数将其设置为无信号状态,否则该对象一直是有信号状态。当一个自动重置的事件对象得到通知时,等待该事件对象的线程中只有一个线程变为可调度线程,同时操作系统会将该事件对象设置无信号状态,这样,当对所保护的代码的执行完成后,需要调用SetE
阅读全文

浙公网安备 33010602011771号