06 2013 档案
摘要:1、首先,在代码文件头部使用#include来包含任何头文件(扩展名为.h或者.hpp的文件)都不会“产生”额外的函数。我们可以说,包含一个头文件之后,该头文件内部已经定义的一些变量,宏,函数等等资源,将可以在后面的代码中可以直接拿来使用,比如,当我们包含process.h之后,就可以在代码中使用system()函数来调用系统控制台的命令,比如cls,、pause等等。同理,包含了windows.h之后,在该文件中定义的一些资源我们可以直接使用,其中包括大部分的Win32 API函数,以及一些Win32宏。具体文件内容你可以找到“C:\Program Files\Microsoft Visua
阅读全文
摘要:// XMLT01.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include "tinyxml2.h"using namespace std;using namespace TinyXml2;void ReadTest01XML(){XMLDocument doc;doc.LoadFile("Test01.xml");const char * content = doc.FirstChildElement("test")->GetText();pri
阅读全文
摘要://GDALTest.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include "gdal_priv.h"#include <iostream>using namespace std;int main(int argc, char* argv[]) {if(argc!=2){return 0;}GDALDataset *poDataset; //数据集对象指针 GDALAllRegister(); //注册驱动poDataset = (GDALDataset *) GDALOpen(argv[1] , G
阅读全文
摘要:#define paster( n ) printf_s( "token" #n " = %d", token##n )int token9 = 9;If a macro is called with a numeric argument like复制paster( 9 );the macro yields复制printf_s( "token" "9" " = %d", token9 );which becomes复制printf_s( "token9 = %d", toke
阅读全文
摘要:#define __FLAG__#ifndef __FLAG__#define DEST str1#else#define DEST str2#endifconst_char_p str1[3]={_T("1"),_T("2"),_T("3")};const_char_p str2[3]={_T("4"),_T("5"),_T("6")};const_char_p * str = DEST;const_char_p s = str[0];const_char_p s1 = s
阅读全文
摘要:#include <commctrl.h >#pragma comment(linker,"\"/manifestdependency:type='win32' \name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")// put t
阅读全文
摘要:// crt_sprintf.c// compile with: /W3// This program uses sprintf to format various// data and place them in the string named buffer.#include int main( void ){ char buffer[200], s[] = "computer", c = 'l'; int i = 35, j; float fp = 1.7320534f; // Format and print various data: j = sp
阅读全文
摘要:WNDPROC wpOrigEditProc; LRESULT APIENTRY EditBoxProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { HWND hwndEdit; switch(uMsg) { case WM_INITDIALOG: // Retrieve the handle to the edit control. hwndEdit = GetDlgItem(hwndDlg, ID_EDIT); // Subclass the edit control. wpOrigEditPro...
阅读全文
摘要:1. API之网络函数WNetAddConnection 创建同一个网络资源的永久性连接WNetAddConnection2 创建同一个网络资源的连接WNetAddConnection3 创建同一个网络资源的连接WNetCancelConnection 结束一个网络连接WNetCancelConnection2 结束一个网络连接WNetCloseEnum 结束一次枚举操作WNetConnectionDialog 启动一个标准对话框,以便建立同网络资源的连接WNetDisconnectDialog 启动一个标准对话框,以便断开同网络资源的连接WNetEnumResource 枚举网络资源WNet
阅读全文
摘要:WINDOWS API 大全 (二)9. API之设备场景函数CombineRgn 将两个区域组合为一个新区域CombineTransform 驱动世界转换。它相当于依顺序进行两次转换CreateCompatibleDC 创建一个与特定设备场景一致的内存设备场景CreateDC 为专门设备创建设备场景CreateEllipticRgn 创建一个椭圆CreateEllipticRgnIndirect 创建一个内切于特定矩形的椭圆区域CreateIC 为专用设备创建一个信息场景CreatePolygonRgn 创建一个由一系列点围成的区域CreatePolyPolygonRgn 创建由多个多边形构
阅读全文