Time of Update: 2018-12-03
前言 50米的網站http://www.50mi.net開張了,所以50米邀請我給他寫點什麼。說實在的,作為一個資深的潛水員,我還真沒動筆寫過什麼東西,所以絞盡腦汁也沒想起來能寫什麼的。不過鑒於50米喜歡在小孩子面前臭屁的,就寫一篇群裡討論很多的sizeof問題吧。1、什麼是sizeof 首先看一下sizeof在msdn上的定義: The sizeof keyword gives the amount of storage, in bytes, associated with
Time of Update: 2018-12-03
在C# 2.0版本中使用Extensions方法 最近在測試一個ftp類時發現其在.netcf V2版本下無法編譯,但是卻可以編譯在3.0版本中。報錯地方如下:using System; using System.Runtime.CompilerServices; public static class Extensions { public static DateTime? ToDateTime(this WINAPI.FILETIME time)
Time of Update: 2018-12-03
C++ GUI Programming with Qt 4 By Jasmin Blanchette, Mark Summerfield ............................................... Publisher: Prentice Hall Pub Date: June 21, 2006 Print ISBN-10: 0-13-187249-4 Print ISBN-13: 978-0-13-187249-3 Pages:
Time of Update: 2018-12-03
在Python中,一切皆為對象,所有的對象都有一些相同的內容,在PyObject中定義。 //xk> 怎樣實現繼承 PyObject是Python中一切(new style)類的基類,其定義非常簡單//xk> Python3.2.2_Source/Include/Object.htypedef struct _object { _PyObejct_HEAD_EXTRA Py_ssize_t ob_refcnt; //xk>
Time of Update: 2018-12-03
編譯/趙湘寧原著:Paul Dilascia MSJ November 1999 & December 1999關鍵字:Bands 對象,Desk Bands,Info/Comm Bands,Explorer Bar,Tool Bands。 本文假設你熟悉C++,COM,IE。下載本文原始碼: MyBands.zip (128KB) TestEditSrch.zip (75KB) 第一部分:Band
Time of Update: 2018-12-03
如果你要在你的C#程式中控制Windows的工作列,有兩個Windows api 可以幫到你!他們就是 FindWindowA 和 ShowWindow C#中聲明如下:using System.Runtime.InteropServices;[DllImport("user32.dll", EntryPoint = "FindWindowA")]public static extern IntPtr FindWindowA(string lp1, string
Time of Update: 2018-12-03
在MFC程式中有TRACE等一系列的宏可以輸出調試資訊, 但是其他的地方不能用了, 下面這個小程式測試了怎麼輸出調試資訊,// Test_ErrorCode.cpp : 定義控制台應用程式的進入點。//#include "stdafx.h"#include <Windows.h>#include <stdio.h>#include <stdarg.h>#include <ctype.h>void __cdecl odprintf(const
Time of Update: 2018-12-03
一.多線程的概念 Windows是一個多任務的系統,如果你使用的是windows
Time of Update: 2018-12-03
const關鍵字並不是表示常量,而是表示“內容不可修改”。const修飾的變數並不一定是值保持不變的,可能由編譯器檢測不到的外部條件改變,const可以和volatile同時修飾一個變數。 const與#define相比較是面試中常見的問題。#define定義常量,由前置處理器進行字元替換,編譯器不進行型別安全檢查。const定義的是一個值恒定的變數,編譯器會對其進行型別安全檢查。在C++中推薦用const替代#define宏定義常量。//xk>
Time of Update: 2018-12-03
#include <stdio.h>#define NR_HP 3#define NR_KIND ((unsigned long)(0xffffffff>>(32-NR_HP)))#define NR_DIM 3static get_nr(unsigned long u32);static void print_hp(unsigned long u32[NR_DIM]){ int i,j, k; printf("{"); for (i=0; i < NR_DIM;
Time of Update: 2018-12-03
利用wininet.dll的RefreshIESettings可以在程式的進程中臨時切換Proxy 伺服器。public struct Struct_INTERNET_PROXY_INFO { public int dwAccessType; public IntPtr proxy; public IntPtr proxyBypass; };
Time of Update: 2018-12-03
#include "windows.h"SERVICE_STATUS gSvcStatus; //服務狀態SERVICE_STATUS_HANDLE gSvcStatusHandle; //服務狀態控制代碼HANDLE ghSvcStopEvent = NULL;//服務停止控制代碼#define SERVER_NAME TEXT("my_server") //服務名VOID WINAPI ServerMain( DWORD,
Time of Update: 2018-12-03
由於c#和Cli的執行碼可以通過反組譯碼得到源碼(只是聽說,沒有實際操練)。對於一些不想公開的代碼,可以用c++編寫再由 C#or cli 調用。從網上找到了幾個方法1:c#->c++2:c#->cli->c++具體描述參見:http://www.cppblog.com/mzty/archive/2008/03/12/44280.html 個人認為 方法1:過於繁瑣,在C#工程中還要對輸出函數進行再聲明,更重要的是
Time of Update: 2018-12-03
說到記憶體管理就一定是與堆記憶體所聯絡,我們知道,自動變數是由棧來實現的,而堆記憶體是由程式員來控制管理的.當我們有這樣一段代碼:void * p=new TYPE NAME(constructor);我們就申請了一塊記憶體.這塊記憶體對於程式員只是透明的一個佔有sizeof(TYPENAME)大小的記憶體塊.並在該記憶體上構造了這個類型的對象. 如果使用placement new實現原理也很簡單,就是傳遞一個指標給new operator.這樣當調用operator
Time of Update: 2018-12-03
編譯/趙湘寧原著:Paul Dilascia MSJ November 1999 & December 1999關鍵字:Bands 對象,Desk Bands,Info/Comm Bands,Explorer Bar,Tool Bands。 本文假設你熟悉C++,COM,IE。下載本文原始碼: MyBands.zip (128KB) TestEditSrch.zip (75KB) 第一部分:Band
Time of Update: 2018-12-03
編譯/趙湘寧原著:Paul Dilascia MSJ November 1999 & December 1999關鍵字:Bands 對象,Desk Bands,Info/Comm Bands,Explorer Bar,Tool Bands。 本文假設你熟悉C++,COM,IE。下載本文原始碼: MyBands.zip (128KB) TestEditSrch.zip (75KB) 第一部分:Band 對象介紹第二部分
Time of Update: 2018-12-03
編譯/趙湘寧原著:Paul Dilascia MSJ November 1999 & December 1999關鍵字:Bands 對象,Desk Bands,Info/Comm Bands,Explorer Bar,Tool Bands。 本文假設你熟悉C++,COM,IE。下載本文原始碼: MyBands.zip (128KB) TestEditSrch.zip (75KB) 第一部分:Band
Time of Update: 2018-12-03
在Visual C++調試器中顯示Symbian字串和描述符 2005-01-12 瀏覽次數:83 文/Peter Jiang(譯自newlc.com) 現在使用Visual Studio有一個令人很不爽的地方,就是處理描述符,因為你不能直接顯示它們的內容(只能在模擬器的視窗裡看到).這裡有一個小技巧將可以讓你顯示Symbian描述符的內容. 為了達到這個目的, Microsoft Visual Studio中的"Auto
Time of Update: 2018-12-03
c++入門學習筆記指標篇來源:http://www.sudu.cn/info/html/edu/code/20071229/79821.html 指標長處: 1。為函數提供修改調用變元的手段; 2。支援C++動態分配子程式 3。能夠改善某些子程式的效率 4。為動態資料結構(如二叉樹、鏈表)提供支援 註:指標為程式引入了一層間接性,能夠操控指標而不直接操控對象。 1。可操控指標內含的地址也可操控指標所指的對象 2。指標可能並不指向任何對象,寫*pi時,可能會使程式在執行期錯誤,如定址到某個對象,
Time of Update: 2018-12-03
一個簡單的學習程式,代碼如下:int fun(){int i,a = 0;for(i = 0; i < 50; i ++){a += i;}return i;}調試查看反組譯碼代碼如下:int fun(){009C1A10 push ebp 009C1A11 mov ebp,esp 009C1A13 sub esp,0D8h 009C1A19 push ebx 009C1A1A push esi