收录查询

多线程脑袋

博客园 首页 联系 订阅 管理
  19 Posts :: 421 Stories :: 29 Comments :: 0 Trackbacks

置顶随笔 #

摘要: The Code Project is constantly growing, with hundreds of new articles added monthly and more sections created to house them. Below is a quick guide to help you find the sections that most interest you...阅读全文
posted @ 2006-08-18 21:25 -> 阅读(298) 评论(0) 编辑

摘要: The Microsoft Foundation Class Library can be divided into two major sections: (1) the MFC classes and (2) macros and globals. If a function or variable is not a member of a class, it is a global func...阅读全文
posted @ 2006-08-18 21:19 -> 阅读(167) 评论(0) 编辑

2006年9月24日 #

http://f4l.sourceforge.net/


顺便COPY段代码先扔这里:

--- d:\vsprojects\vcpros\consolepros\vckbase1\first.cpp  -------------------
1:    #include <stdio.h>
2:
3:    int main(int argc, char** argv, char** envp)
4:    {
00401010   push        ebp  ;save ebp(cpu->内存)
00401011   mov         ebp,esp  ;set stack frame pointer
00401013   sub         esp,40h  ;allocate space for locals
00401016   push        ebx  ;save registers-------下面内容均如此
00401017   push        esi
00401018   push        edi
00401019   lea         edi,[ebp-40h]
0040101C   mov         ecx,10h
00401021   mov         eax,0CCCCCCCCh
00401026   rep stos    dword ptr [edi]
5:        return 0;
00401028   xor         eax,eax
6:    }
0040102A   pop         edi
0040102B   pop         esi
0040102C   pop         ebx  ;restore registers
0040102D   mov         esp,ebp  ;restore stack pointer
0040102F   pop         ebp  ;restore ebp
00401030   ret    ;return from function
--- No source file  --------------------------------------------------------


argc = 1 ;因为在VC中要读取你的*argv指向的应用程序名字(*.exe)
* argv = D:\VSPROJECTS\VCPROS\CONSOLEPROS\vckbase1\Debug\vckbase1.exe
* envp = ALLUSERSPROFILE=C:\Documents and Settings\All Users

 =============================================================

Considerations when Writing Prolog/Epilog Code

Microsoft Specific —>

Before writing your own prolog and epilog code sequences, it is important to understand how the stack frame is laid out. It is also useful to know how to use the __LOCAL_SIZE predefined constant.

C Stack Frame Layout

This example shows the standard prolog code that might appear in a 32-bit function:

push     ebp                 ; Save ebp
mov      ebp, esp            ; Set stack frame pointer
sub      esp, localbytes     ; Allocate space for locals
push     <registers>         ; Save registers

The localbytes variable represents the number of bytes needed on the stack for local variables, and the registers variable is a placeholder that represents the list of registers to be saved on the stack. After pushing the registers, you can place any other appropriate data on the stack. The following is the corresponding epilog code:

pop      <registers>         ; Restore registers
mov      esp, ebp            ; Restore stack pointer
pop      ebp                 ; Restore ebp
ret                          ; Return from function

The stack always grows down (from high to low memory addresses). The base pointer (ebp) points to the pushed value of ebp. The local variables area begins at ebp-2. To access local variables, calculate an offset from ebp by subtracting the appropriate value from ebp.

The __LOCAL_SIZE Constant

The compiler provides a constant, __LOCAL_SIZE, for use in the inline assembler block of function prolog code. This constant is used to allocate space for local variables on the stack frame in custom prolog code.

The compiler determines the value of __LOCAL_SIZE. The value is the total number of bytes of all user-defined local variables and compiler-generated temporary variables. __LOCAL_SIZE can be used only as an immediate operand; it cannot be used in an expression. You must not change or redefine the value of this constant. For example:

mov      eax, __LOCAL_SIZE           ;Immediate operand--Okay
mov      eax, [ebp - __LOCAL_SIZE]   ;Error

The following example of a naked function containing custom prolog and epilog sequences uses __LOCAL_SIZE in the prolog sequence:

__declspec ( naked ) func()
{
int i;
int j;
__asm      /* prolog */
{
push   ebp
mov      ebp, esp
sub      esp, __LOCAL_SIZE
}
/* Function body */
__asm      /* epilog */
{
mov      esp, ebp
pop      ebp
ret
}
}  

END Microsoft Specific

 

 

 


 

posted @ 2006-09-24 17:31 -> 阅读(446) 评论(0) 编辑

2006年8月18日 #

 

The Code Project is constantly growing, with hundreds of new articles added monthly and more sections created to house them. Below is a quick guide to help you find the sections that most interest you.

Desktop Development Total: 3,332 articles


Web Development Total: 4,051 articles


Enterprise Systems Total: 371 articles


Multimedia Total: 985 articles


Database Total: 1,027 articles


Platforms, Frameworks & Libraries Total: 3,041 articles


Languages Total: 4,898 articles


General Programming Total: 2,762 articles


Graphics / Design Total: 53 articles


Development Lifecycle Total: 821 articles


General Reading Total: 671 articles


Third Party Products Total: 253 articles


posted @ 2006-08-18 21:25 -> 阅读(298) 评论(0) 编辑

The Microsoft Foundation Class Library can be divided into two major sections: (1) the MFC classes and (2) macros and globals. If a function or variable is not a member of a class, it is a global function or variable.

The MFC library and the Active Template Library (ATL) share string conversion macros. See String Conversion Macros in the ATL documentation for a discussion of these macros.

The MFC macros and globals offer functionality in the following categories:

General MFC

Database

Internet

DHTML Event Maps

OLE

In addition, MFC provides a function called AfxEnableControlContainer that enables any OLE container developed with MFC 4.0 to fully support embedded OLE controls.

OLE Controls

The first part of this section briefly discusses each of the previous categories and lists each global and macro in the category, along with a brief description of what it does. Following this alphabetically are complete descriptions of the global functions, global variables, and macros in the MFC library.

To find more information on MFC Macros and Globals, see MFC Macros and Globals.

Note   Many global functions start with the prefix "Afx", but some, such as the dialog data exchange (DDX) functions and many of the database functions, deviate from this convention. All global variables start with "afx" as a prefix. Macros do not start with any particular prefix, but they are written in uppercase letters.
posted @ 2006-08-18 21:19 -> 阅读(167) 评论(0) 编辑

2006年7月27日 #

(1)袁峰
精: 很多东西都有更好的方法, 不要满足于做出来而已
深: 看看 David Solomon, Jeffrey Richter, John Robbins, 和我的书,再和 Charles Petzold 的书比

比你就知道深浅之别
迁: 找高人所在
著: 写东西是很好的学习
器: 写工具程序, 见 www.sysinternals.com

(2)各种操作系统平台开发GUI程序使用的库的介绍
High-level widget toolkits:
*On Macintosh:
**Cocoa - used in Mac OS X (see also Aqua)
**MacApp Macintosh framework
**MacZoop Macintosh C++ framework
**Powerplant Macintosh framework
*On Microsoft Windows:
**The Microsoft Foundation Classes (MFC), used by Microsoft for its own programs (e.g. Microsoft Office) and by most developers on the Microsoft Windows platform
**The Object Windows Library is sort of Borland's alternative to MFC
**The Visual Component Library (VCL) is Borland's toolkit used in its C++ Builder and Delphi products
**The Windows Forms is .NET's set of classes that handle GUI controls
*On Unix, under the X Window System:
**Xaw, the Project Athena widget set for the X Window System
**Motif used in the Common Desktop Environment
**Lesstif, an open source (LGPL) version of Motif
*Cross-platform, based on SVG:
**airWRX is an application framework that runs from a USB flash drive, and turns its PC host and other nearby PCs into a multi-screen, web-like work environment.
*Cross-platform, based on the Java programming language:
**The Abstract Windowing Toolkit is used in Java applications. It typically uses another toolkit on the selected platform in turn.
**Swing is Sun Microsystems's replacement for AWT in newer Java versions.


**The Standard Widget Toolkit is a native widget toolkit for Java that was invented as part of the Eclipse project. SWT will use the running platforms widget toolkit (such as Windows API or GTK+) underneath.
(Eclipse开发工具有很多的插件可以使用,用于C++开发的插件有CDT等,还有用于FLASH ACTIONSCRIPT开发的插件<这个要负费的>)
Cross-platform, based on the programming languages C or C++, often with bindings to other languages:


**Tk, a widget set accessed from Tcl and other high-level script languages.


**GTK+, open source (LGPL), primarily for the X Window System, ported to and emulated under other platforms; used in the GNOME desktop environment
(GNOME平台使用GTK+)

**Qt, open source (GPL) available under Unix/Linux (with X Window), MS Windows, Mac OS X and embedded systems; also available in commercial versions under these platforms; used in KDE
(KDE平台使用QT图形库)

**wxWidgets (formerly wxWindows), open source (relaxed LGPL), abstracts toolkits across several platforms for C++, Python and Perl
(C++,Python和Perl等都可以使用wxWidgets库进行开发)

**FOX toolkit, open source (LGPL), genuinely cross-platform


**FLTK, open source (LGPL), cross-platform toolkit designed to be small and fast

posted @ 2006-07-27 18:31 -> 阅读(292) 评论(0) 编辑

2006年6月10日 #

摘要: 所有资源都来源于Internet..........,很多的问题答案给得太死,实际上可以有多种答案,有的非让你说出来2条可能说起来一条就能够表达的很清楚了,贴这些考试题目的目的是“温故而知新!!”文章来源于:http://www.itquan.com/user1/2059/subject/163.html发布之前先申明两点: 1 所有资料来自网络(主要是CSDN),本人只是...阅读全文
posted @ 2006-06-10 08:17 -> 阅读(5709) 评论(0) 编辑

2006年3月25日 #

原文地址:http://blog.vckbase.com/bruceteen/archive/2005/09/16/12160.html

#include <iostream>
using namespace std;

template <size_t n> void foo( void )
{
    cout << n << endl;
};
void bar1( void )
{
    foo<1>();
}
void bar2( void )
{
    foo<2>();
}

int main(int argc, char* argv[])
{
    bar1();
    bar2();

    return 0;
}

// 期待输出 1 2
// 实际输出 2 2
==========================
VC的开发工程师可能以为所有的人都会这么用:

#include <iostream>
using namespace std;

template <class T>
T foo( size_t n)
{
    cout << n << endl;
 return 0;
};
void bar1( void )
{
    foo<size_t>(1);
}
void bar2( void )
{
    foo<size_t>(2);
}

int main(int argc, char* argv[])
{
    bar1();
    bar2();

    return 0;
}

 

posted @ 2006-03-25 23:55 -> 阅读(166) 评论(0) 编辑

2006年3月21日 #

摘要: 转贴文同样没给出出处,所以本文省略出处........一:一个目标 一艘没有航行目标的船,任何方向的风都是逆风 1、你为什么是穷人,第一点就是你没有立下成为富人的目标 2、你的人生核心目标是什么? 杰出人士与平庸之辈的根本差别并不是天赋、机遇,而在于有无目标。 3、起跑领先一步,人生领先一大步:成功从选定目标开始 4、贾金斯式的人永远不会成功 为什么大多数人没有成功?真正能完成自己计划的人只有5%...阅读全文
posted @ 2006-03-21 22:39 -> 阅读(168) 评论(0) 编辑

2006年3月17日 #

摘要: Official resourcesMSDNVisual C++ Homemicrosoft.public.vc.languageThe TopCodeGuruCodeProjectDeveloperFusion.comC/C++ Users JournalRSDN (RU)First Steps (RU)Sources.ru (RU)Tricks, Tips, FAQsBjarne Strous...阅读全文
posted @ 2006-03-17 23:07 -> 阅读(329) 评论(0) 编辑

摘要: 为了方便查阅,原文地址: http://www.codeproject.com/cpp/cppforumfaq.asp#mfc_cstrtopchar===============================================================================About This FAQLatest additions and updates.Wel...阅读全文
posted @ 2006-03-17 22:42 -> 阅读(1536) 评论(0) 编辑

2006年3月2日 #

摘要: 找到类似这样问题的解决办法:“Loaded ’D:\WINDOWS.0\system32\kernel32.dll’, no matching symbolic information found.“通常使用VC6.0的时候,安装过后在开始菜单中有:Microsoft Visual Studio 6.0-> Tools->Windows ...阅读全文
posted @ 2006-03-02 12:22 -> 阅读(785) 评论(0) 编辑

2006年2月26日 #

摘要: (1)WINDOWS阵营 <----------> 非WINDOWS阵营(2)C/C++阵营 <----------> 非C/C++阵营......................................................................................这导致了4类人:(1)[狭义]能够游弋于绳子两端的人,自是功力深厚....阅读全文
posted @ 2006-02-26 22:14 -> 阅读(154) 评论(0) 编辑

2006年2月25日 #

摘要: 原文地址:http://blog.csdn.net/toby/archive/2004/10/24/149366.aspx我怎么又比别人晚了进2年的时间,后面我会重新写一篇文章,算是对该文的整理吧!C++里virtual的缺陷就是vtable会增大代码的尺寸,看vcl时,object pascal里virtual也有vtable的问题,于是又了dynamic,两种方法各有利弊。但是在C++里却没有...阅读全文
posted @ 2006-02-25 22:37 -> 阅读(633) 评论(0) 编辑

摘要: 文章来源:http://www.exuetang.net/article/View.aspx?NewsID=831、分粥   有七个人曾经住在一起,每天分一大桶粥。要命的是,粥每天都是不够的。一开 始,他们抓阄决定谁来分粥,每天轮一个。于是乎每周下来,他们只有一天是饱的,就是自己分粥的那一天。后来他们开始推选出一个道德高尚的人出来分粥。强权 就会产生腐败,大家开始挖空心思去讨好他,贿赂他,搞得整个...阅读全文
posted @ 2006-02-25 13:47 -> 阅读(151) 评论(0) 编辑

2006年2月24日 #

摘要: 来源于MSDN2001中文章:TN024: MFC-Defined Messages and ResourcesMFC private Windows messages are in the range 0x360->0x37F.//MFC私有消息范围:0x360->0x37FMFC private resource types are in the range 0xF0->0x...阅读全文
posted @ 2006-02-24 16:13 -> 阅读(666) 评论(0) 编辑

2006年1月15日 #

摘要: Teach Yourself Programming in Ten Years 为什么每个人都急不可耐?走进任何一家书店,你会看见《Teach Yourself Java in 7 Days》(7天Java无师自通)的旁边是一长排看不到尽头的类似书籍,它们要教会你Visual Basic、Windows、Internet等等,而只需要几天甚至几小时。我在Amazon.com上进行了如下搜索:pub...阅读全文
posted @ 2006-01-15 21:34 -> 阅读(238) 评论(0) 编辑

2005年12月17日 #

摘要: 原型:[virtual]void CObject::AssertValid() const //说明:该成员函数只能对成员变量做"引用型"操作,不能做"加工型"操作{ASSERT(this != NULL);}MSDN:When you write your own class, you should override the AssertValid function to provide dia...阅读全文
posted @ 2005-12-17 18:26 -> 阅读(239) 评论(0) 编辑

2005年12月15日 #

摘要: anyType anyName;anyType anyName();anyType anyName(Type1 LocalName1, Type2 LocalName2, Type3 LocalName3, .......);阅读全文
posted @ 2005-12-15 22:38 -> 阅读(139) 评论(0) 编辑

2005年12月14日 #

摘要: #include "stdafx.h"#ifdef AFX_INIT_SEG#pragma code_seg(AFX_INIT_SEG)#endif#ifdef _DEBUG#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif////////////////////////////////////////////////////////...阅读全文
posted @ 2005-12-14 23:34 -> 阅读(534) 评论(0) 编辑

2005年8月11日 #

posted @ 2005-08-11 17:03 -> 阅读(540) 评论(0) 编辑