星期二, 9月 23, 2008

Delphi Distiller V1.51


Homepage:http://alvarogp.googlepages.com/

Download


1. WHAT IS DELPHI DISTILLER
Delphi Distiller is a customization tool for Delphi 5/6/7/2006/2007/2009 that
lets you manage packages and experts and apply several tweaks.


2. FEATURES
Choose what packages and experts are loaded by Delphi 5/6/7/2006/2007/2009.

File associations manager for Delphi 5/6/7/2006/2007/2009.

Delphi 5 tweaks:
- Don't create .~bpl files.
- Don't create .cfg files.
- Use Tahoma font by default.
- Don't show splash screen.
- Customize editor colors.
- Trial to Retail conversion.

Delphi 6 tweaks:
- Don't create .~bpl files.
- Don't create .ddp files.
- Don't create .cfg files.
- Use Tahoma font by default.
- Don't show splash screen.

Delphi 7 tweaks:
- Don't create .~bpl files.
- Don't create .ddp files.
- Don't create .cfg files.
- Use Tahoma font by default.
- Don't show splash screen.

Delphi 2006 tweaks:
- Don't create .~bpl files.
- Don't create .local files.
- Don't create .cfg files.
- Remove toolbar gradients.
- Fix TabStop bug in TFrame's.
- Don't show splash screen.

Delphi 2007 tweaks:
- Don't create .~bpl files.
- Don't create .local files.
- Don't check for updates when the IDE starts.
- Avoid loading of additional .NET crap by delphicoreide100.bpl.
- Remove toolbar gradients.
- Don't show splash screen.

Delphi 2009 tweaks:
- Don't create .~bpl files.
- Don't create .local files.
- Don't check for updates when the IDE starts.
- Avoid loading of additional .NET crap by delphicoreide120.bpl.
- Don't show splash screen.



Hot key Ctrl + ALt + L 鍵 會有意想不到的收獲

Adding Commands to the Ribbon

This topic follows in sequence the creation of a ribbon application using either the Ribbon Application Wizard or the manual steps described in Creating an Application that Uses Ribbon Controls

This topic assumes that you are familiar with the TActionManager component and the components associated with its use. Numerous new properties have been added to help support the ribbon requirements. Many existing properties have no effect when modified on a command that is displayed on the ribbon. 

For instance:

  • Small buttons always display their glyph to the left of the caption.
  • Large buttons always display their glyph at the top.
  • A Large button must have a caption. The caption can be a maximum of two lines, and the button width is resized accordingly. A large button's height is fixed to cover the height of the group where the command is displayed.
  • Only small buttons with no caption can be displayed in groups. 

Creating an Application that Uses Ribbon Controls

Creating an Application that Uses Ribbon Controls

This procedure describes how to create an application that uses ribbon controls. The core ribbon functionality is derived from the TRibbon component. While the ribbon uses other components, none of the core components are registered on the tool palette.  

Components:

  1. TRibbon: Main visual component that provides most functionality.
  2. TRibbonApplicationMenuBar: Component that provides the functionality of the application menu.
  3. TRibbonQuickAccessToolbar: Component that provides the functionality of the Quick Access Toolbar
  4. TRibbonPage: Component that represents the page of the ribbon that is currently visible
  5. TRibbonGroup: Component that all of the pages commands are displayed in. Commands must be placed in a group.
 

To create a new application that uses ribbon controls

  1. Create a new Delphi Win32 VCL application (select New VCL Forms Application — Delphi for Win32).
  2. Drop a TActionManager component onto the form.
  3. Drop a TRibbon component onto the form.
  4. Right-click the TRibbon component and select the Add Application Menu item.
  5. Right-click the TRibbon component again and select the Add Quick Access Toolbar item.
Note: During initial configuring of the ribbon you might see a dialog saying that the current style selected in the TActionManager.Style is not a valid ribbon style. Change the TRibbonManager.Style property to be the Ribbon – Luna. Applicable styles for use with the ribbon have the Ribbon prefix. By default three ribbon styles are implemented. These ribbon styles also work with the default ActionManager toolbar and menu bar controls. The available ribbon Styles are:
  • Luna
  • Obsidian
  • Silver 

TStringBuilder 類別- C++ Builder 2009的新成員

TStringBuilder的出現,意味Codegear有意讓C++ Builder支援.NET了...但一切只是憶測.....



TStringBuilder 類別

include  SysUtils.hpp

Use a TStringBuilder as an editable string.  

The TStringBuilder class is completely compatable with the .Net framework's StringBuilder (MSDN) class. Use a TStringBuilder instance to hold a character array. This array can be modified after creation. Substrings can be appended, searched and replaced, or inserted. The character array can be queried by index or converted to a string for comparison.  

The character array can be referenced directly by using the Chars property. The Length property contains the current length of the character array.  

builder.Length = builder.ToString.Length;  

The Capacity property holds the current allocated storage space for this TStringBuilder instance. Capacity can be increased up to the value of MaxCapacity and down to the current value of Length. Capacity is increased if Length is increased, or the character array is altered by appending to increase it's length.  

The Append method converts a multitude of possible types to a string and appends that to the current character array. AppendFormat allows you to append several objects to the character array, each object with it's own format.  

The Equals method compares a specified object or another TStringBuilder to this instance of TStringBuilder.  

The Append, CopyTo, Insert, Remove and Replace methods access the character array by index or search the character as a string. The ToString method converts the character array to a string to provide string functionality.  

TStringBuilder is an implementation of the .NET StringBuilder (MSDN) class.  

C++ Examples: 

 /*

This example exercises many of the members of the TStringBuilder class.

*/

template

void testAppend(T t)
{
    std::auto_ptr builder(new TStringBuilder());
    builder->Append(t);
    UnicodeString s1 = builder->ToString();
    UnicodeString s2(t);
    assert(s1 == s2);

}

#if defined(_DELPHI_STRING_UNICODE)

const wchar_t* ext_chars =

    L"А Б Ð’ Г Д Є Ж Ð… З И І"
    L"К Л М Н О П Ò€ Ð  Ð¡ Т Ѹ"
    L"Ф Ð¥ Ñ  Ð¦ Ч Ш Щ Ъ Ы Ь Ñ¢"
    L"Ю ІА Ѧ Ѩ Ѫ Ѭ Ñ® Ѱ Ѳ Ñ´ Ѥ";
#else

const char* ext_chars =

    "À Á Â Ã Ä Ã… Æ Ç È É Ê Ë ÃŒ Í ÃŽ Ï"
    "Ð Ñ Ã’ Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß"
    "à  Ã¡ â ã ä Ã¥ æ ç è é ê ë ì í î ï"
    "ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ";
#endif


//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    {
        // Test starts out as empty
        std::auto_ptr builder(new TStringBuilder());
        assert(builder->ToString() == System::String());
    }
  

   {
        // Append
        short s = 0xffe;
        testAppend(s);
        unsigned short us = 0xfffe;
        testAppend(us);

    }


    {

        const _DCHAR* p = ext_chars;

        std::auto_ptr builder(new TStringBuilder());
        System::String str1(p);

        // Appending of wchar_t

        while (*p) 
        {
            builder->Append(*p++);
        }

        // Length property

        assert(builder->Length == str1.Length());

        // Subscript operator

        for (int i=0; i
        {
            // NOTE: strings are 1-based
            assert((*(builder.get()))[i] == str1[i+1]);
        }


        // ToString()

        System::String str2 = builder->ToString();
        Edit1->Text = str1;
        Edit2->Text = str2;
        assert(str2 == str1);

        // Replace

        builder->Replace(' ', '.');
        UnicodeString str3;
        str3 = builder->ToString();
        Edit3->Text = str3;
        assert(str3 != str2);

        // Replace back

        builder->Replace(L'.', L' ');
        System::String str4 = builder->ToString();
        Edit4->Text = str4;
        assert(str2 == str4);
    }


    {
        System::String str(ext_chars);
        std::auto_ptr builder(new TStringBuilder());
        // Insert at start when empty, at start when not empty and at end

        builder->Insert(0, str);
        builder->Insert(0, str);
        builder->Insert(builder->Length, str);

        // Concatenate string 3 times

        System::String str2;
        str2 += str;
        str2 += str;
        str2 += str;

        str = builder->ToString();
        Edit5->Text = str;
        assert(builder->ToString() == str2);
    }

    MessageDlg("All assertions passed in the TStringBuilder Test test.",
        mtInformation, TMsgDlgButtons() <<>

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)
{
    const _DCHAR* p = ext_chars;
    std::auto_ptr builder(new TStringBuilder());

    // Appending of chars

    while (*p) 
    {
        builder->Append(*p++);
    }

    System::String str1(ext_chars);
    System::String str2 = builder->ToString();
    assert(str1 == str2);

    builder->Replace(_D(" "), _D("."));
    System::String str3;
    str3 = builder->ToString();
    assert(str1 != str3);

    builder->Replace(_D("."), _D(" "));
    System::String str4(builder->ToString());
    assert(str1 == str4);
    MessageDlg("All assertions passed in the TStringBuilder Replace test.",
        mtInformation, TMsgDlgButtons() <<>

}



Codegear C++ Builder 2009 試用版出現了

http://www.codegear.com/products/cppbuilder

C++Builder 2009 V12.0.3170.16989 ISO檔約1.9GB
http://altd.codegear.com/download/Delphi_C++Builder2009/Delphi_C++Builder2009.iso

































1. 全新語言功能Delphi 泛型程式設計完整的支援 RTL 串列和集合資料結構支援。Delphi 匿名方法。採用 UnicodeString 類型作為預設字串類型。C++Builder 是第一個在業界支援即將推出的 C++0x 語言標準,其中包括 move 語意、範圍列舉、明確的轉換運算子、靜態斷言和類型特質、decltype、extern 範本和 Unicode 字元。C++Builder 新增程式庫包括 TR1 和 Boost。Delphi 在 C++Builder 上與類別方法和靜態內容的相容性提升

2. IDE 新增和強化功能共用的組建組態。具名選項的設定可將組建組態儲存並套用至任何專案。Delphi 編譯器選項可將警告視為錯誤處理。Delphi Class Explorer 提供整個專案中類別程式庫的可設定階層式檢視、快速瀏覽宣告和實作,以及輕鬆加入欄位和方法。「資源管理程式」大幅簡化在專案中加入資源的動作。C++Builder 現在提供 LiveSource 雙向 UML 建模。預先編譯的 C++Builder 標頭精靈。

3. 全新 VCL 功能VCL 元件和主題,其中包括 TButtonedEdit、TBalloonHints、TCategoryPanelGroup。TImage 和 TImageList 中支援 PNG 影像格式。「功能區控制項」元件,用於建立 Microsoft Office 風格的功能區介面。強化 TButton、TEdit、TListView、TTreeView、TLabel、主題和 Vista Aero 支援。網頁適用的新版 VCL,用於建立啟用 AJAX 和 Silverlight 的豐富內部網路和網頁應用程式。

4. 擴充的多層資料庫技術新一代 DataSnap。全新的 ServerMethods 可完全掌控中層功能。從伺服器呼叫程序,程式碼仿佛就在用戶端上。持續使用熟悉的 IAppServer 介面,同時擴充應用程式伺服器的強大功能。全新的 DataSnap 架構中無任何 COM 相依性。輕易將現有的伺服器轉移至新架構。

5. 全新的 Unicode、國際化和本地化整個 IDE 完全啟用 Unicode。強化的整合性翻譯環境 (ITE),可檢視和編輯 VCL 表單和資源字串。強化的外部翻譯管理程式 (ETM),可檢視和編輯 IDE 以外的語言資源檔。強化的「資源 DLL 精靈」,可建立 Win32 資源 DLL 進行本地化。強化的「翻譯儲存庫」提供翻譯資料庫,可在專案之間共用。

6. COM 和 ActiveX 的新功能強化的「匯入元件」精靈,可匯入類型程式庫、ActiveX 控制項或 .NET Assembly。強化的「元件」精靈,可建立新元件的單位。TStringBuilder,可更快更輕鬆串連字串 完全重新架構的 COM/ActiveX 支援現在可透通存取 IDL 和程式碼。更新的精靈支援將現有的 VCL 元件包裝為 ActiveX 控制項。

7. 更新的其他元件和軟體InterBase 2009 Developer Edition—最多 20 個使用者和 80 個邏輯本機連線。更新的 TeeChart 8.0 圖表處理元件。更新的 Rave Reports 7.6。更新的 VCL,適用於 Web RAD 網頁應用程式架構。

datasheet:http://www.codegear.com/article/38534/images/38534/CBuilder2009Datasheet.pdf

星期四, 6月 24, 2004

OLE Drag and Drop Sample Applications

http://www.unitoops.com/uoole/examples/

Sample Application: CPPOutlookTest.cpp


First: C++Builder

C++Builder programs consist of a project source code file, one or more source code unit files, a unit header file, and other files that you probably won't edit directly. The project source contains the main program, which is created automatically and usually does nothing more than call the application's Initialize(), CreateForm(), and Run() methods. Unit source code files contain the program's functions, procedures, and event handlers. C++Builder's visual environment and class library handle many of the traditional Windows programming details such as setting up the window class, the window procedure, and the message loop.

Here is the C++Builder project source code file for our first example program:


/***************************************************************************** *
* First.cpp *
* FirstU.cpp *
* *
* This is the first Fastgraph for Windows example program. It demonstrates *
* tasks common to most Fastgraph for Windows programs and serves as a *
* template for building the other examples. *
* *
\****************************************************************************/
#include
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("FirstU.cpp", Form1);
USERES("First.res");
USELIB("FGWBC32.LIB");
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}

Note how the project source code file includes a USELIB statement referencing Fastgraph's Borland C++ library (FGWBC32.LIB). This is included automatically when you add the library file to your project in the C++Builder IDE. Also, note the USEFORM statement that references the FirstU.cpp unit source code file, which in turn includes the FirstU.h unit header file. This is likewise added automatically when you create the project.

The FirstU.cpp unit source code file contains an #include directive to include the FirstU.h unit header file. Near the beginning of the unit header file, we add another #include directive referencing Fastgraph's FGwin.h header file. The user declarations section of the unit header file is a good place to define global variables used in the event handlers of the unit source code file. C++Builder automatically creates and maintains the rest of the unit header file for you. The FirstU.h unit header file is shown here:


//---------------------------------------------------------------------------
#ifndef FirstUH
#define FirstUH
//---------------------------------------------------------------------------
#include
#include
#include
#include
#include
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
void __fastcall FormActivate(TObject *Sender);
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormPaint(TObject *Sender);
void __fastcall FormResize(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
private: // User declarations
HDC hDC;
HPALETTE hPal;
int hVB;
UINT cxClient, cyClient;
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

And here is the FirstU.cpp unit source code file, which contains our event handlers:


/***************************************************************************** *
* First.cpp *
* FirstU.cpp *
* *
* This is the first Fastgraph for Windows example program. It demonstrates *
* tasks common to most Fastgraph for Windows programs and serves as a *
* template for building the other examples. *
* *
\****************************************************************************/
#include
#pragma hdrstop
#include "FirstU.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormActivate(TObject *Sender)
{
fg_realize(hPal);
Invalidate();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
hDC = GetDC(Form1->Handle);
fg_setdc(hDC);
hPal = fg_defpal();
fg_realize(hPal);
fg_vbinit();
hVB = fg_vballoc(640,480);
fg_vbopen(hVB);
fg_vbcolors();
fg_setcolor(19);
fg_fillpage();
Application->OnActivate = OnActivate;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
fg_vbscale(0,fg_getmaxx(),0,fg_getmaxy(),0,cxClient-1,0,cyClient-1);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormResize(TObject *Sender)
{
cxClient = ClientWidth;
cyClient = ClientHeight;
Invalidate();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
fg_vbclose();
fg_vbfree(hVB);
fg_vbfin();
DeleteObject(hPal);
ReleaseDC(Form1->Handle,hDC);
}

The FirstU.cpp unit is essentially made up of event-handling procedures that provide our first look at some Fastgraph functions. Note that our program does not explicitly call the event procedures. Instead, they are called by C++Builder's class library in response to Windows events such as creating or resizing the window (these procedures are analogous to the traditional WindowProc() message handlers). Our program includes event handlers for the form's OnCreate, OnActivate, OnPaint, OnResize, and OnDestroy events. You can use C++Builder's Object Inspector to generate code templates for these form event handlers.

An OnCreate event occurs when the form is first created during program execution. This event occurs once per program instance and is analogous to the WM_CREATE Windows message. Hence, it is a good place for any application-specific initialization code. Our OnCreate handler is in the FormCreate() procedure and first calls the Windows API function GetDC() to obtain a device context to the form's client area. It then calls fg_setdc() to make the device context available to other Fastgraph functions:


hDC = GetDC(Form1->Handle);
fg_setdc(hDC);

Next, it creates and realizes the default logical palette:


hPal = fg_defpal();
fg_realize(hPal);

The OnCreate handler then initializes Fastgraph's virtual buffer environment, creates a 640x480 virtual buffer and makes it the active virtual buffer, and assigns the logical palette colors to the virtual buffer:


fg_vbinit();
hVB = fg_vballoc(640,480);
fg_vbopen(hVB);
fg_vbcolors();

Next, we fill the virtual buffer with blue pixels (color 19 is blue when using Fastgraph's default 256-color virtual buffers with the default logical palette):


fg_setcolor(19);
fg_fillpage();

The last thing the OnCreate event handler does is set up the pointer to the application's OnActivate handler:


Application->OnActivate = OnActivate;

The application's OnActivate handler (which has a different purpose than the form's OnActivate handler) executes when the program gains the input focus. This happens when control shifts from another Windows application to our program, so it is thus analogous to the WM_SETFOCUS Windows message. Because we want the application's OnActivate handler to perform the same tasks as the form's OnActivate handler, we simply point the application's handler to the form's handler. The form's OnActivate handler, and hence the application's OnActivate handler, first calls fg_realize() to activate the program's logical palette (in case another program has changed the logical palette colors). It then calls C++Builder's Invalidate() function to force an OnPaint event to redraw the form's client area. This sequence is typical of OnActivate event handlers in Fastgraph programs.

An OnPaint event occurs when the form's client area must be repainted; it is analogous to the WM_PAINT Windows message. Our OnPaint handler is in the FormPaint() procedure and just calls fg_vbscale() to display the contents of the 640x480 virtual buffer scaled to the size of the form's client area. This sequence is typical of OnPaint event handlers in Fastgraph programs.

You can remove the OnActivate event handler by calling fg_realize() before fg_vbscale() in the OnPaint handler. While this eliminates the work of manually creating an application event handler, it introduces overhead in OnPaint because it must realize the logical palette every time the form is repainted. This wouldn't be noticeable in a simple program like our first example. However, in games or other applications where we frequently update the form (and hence frequently execute the OnPaint handler), we recommend using a separate OnActivate handler that realizes the logical palette only when needed.

An OnResize event occurs whenever the size of the form changes, and also upon creation of a form. It is analogous to the WM_SIZE Windows message. Our OnResize handler is in the FormResize() procedure and simply saves the new width and height of the client area (in pixels) in the variables cxClient and cyClient. These quantities are passed to fg_vbscale() in the OnPaint event handler.

An OnDestroy event occurs after removing a form and often signals a program exit; it is analogous to the WM_DESTROY Windows message. Our OnDestroy handler is in the FormDestroy() procedure and first closes the virtual buffer, releases its memory, and terminates virtual buffer processing:


fg_vbclose();
fg_vbfree(hVB);
fg_vbfin();

It then calls two Windows API functions to delete the logical palette created with fg_defpal() and release the device context created with GetDC():


DeleteObject(hPal);
ReleaseDC(Form1->Handle,hDC);

Each C++Builder example supplied with Fastgraph consists of six files comprising a C++Builder project. The unit source code, unit header, and graphical form files will have the same name as the Fastgraph example, but with the letter "U" appended to the file name. For example, the six files for the First example project are:


First.cpp
project source code file

First.mak
project make file

First.res
project resource file

FirstU.cpp
unit source code file

FirstU.h
unit header file

FirstU.dfm
graphical form file



In general, we'll only be working with the unit source code and header files for each project, as they contain the event handling procedures and their global variables. We'll let C++Builder's visual programming environment handle the maintenance of the other files. For more information about these files, please consult your C++Builder manuals.


<< Prev
Next >>






Contents
Fastgraph Home Page


copyright 2001 Ted Gruber Software, Inc.

Application Development

This discussion is currently limited to the Intel-based compiler. All arguments are widened to 32-bits when passed to functions. Return values are 32-bits and are returned in EAX, except 8 byte structures returned in

EAX: EDX. The 32-bit C compiler provides several ways to call functions, but the pascal _fortran and _syscall conventions are obsolete. Supported calling conventions for functions are defined by the keywords:

_cdeclDefault C calling convention. Caller cleans up stack, so vararg functions are supported. Arguments pushed on stack right to left. _cdecl 1 functions prefixed by when decorated.

_stdcall Stacked cleaned up by called function, so compiler makes vararg functions cdec 1, and a function prototype is required. Arguments pushed on stack right to left and function is prefixed with _ and postfixed with @x when decorated, where x is the number of bytes to be pushed on the stack. Faster calling and smaller code than for _cdecl, if number of function calls > number of functions.

_fastcall Similar to _stdcall but speeds up call by storing at most two arguments in EAX and EDX.

All other arguments pushed as for _stdcall. Functions are prefixed with @ and postfixed with @x when decorated, where x is the number of bytes to be pushed on the stack..
These are also controlled for entire source files by the /Gd, /Gz, and /Gr options respectively.

The strict calling convention for Windows functions generally is WINAPI, and CALLBACK for user-defined callbacks. Both were defined to be FAR (far) PASCAL (pascal) in the Windows 3.x API, passing parameters in left to right order, and tidying the stack by removing their arguments before passing control back to the calling environment. They are invoked by a far call, and pointers passed as arguments are far pointers.

In contrast, Win32 API functions and user-defined callbacks use the _stdcall calling convention as

PASCAL,WINAPI, CALLBACKetc are defined to be _stdcall. Functions are invoked by a near call, and addresses passed as arguments are always near pointers. FAR has been defined to nothing. The /Zf option on the compiler ignores the _far keyword, which aids I 6->32-bit portability. The compiler still allows the .._pascal keyword for pascal calling convention, so watch out if you���ve defined any callbacks using pascal explicitly. Pascal calling convention is callee cleans up stack, arguments pushed left to right.


The development cycle for 32-bit graphical or console applications follows an established pattern; source code written in assembler or a high level language is compiled or assembled to give object code, which is linked with libraries and run-time support modules to produce a final executable file. 32-bit Graphical Windows applications may also need to compile resource scripts into binary form and link them into the executable.

Visual C++ 6.0 provides a complete Windows NT based 32-bit development environment; source and resource editors, compiler, linker, librarian, debugger and resource compiler.

In order to make use of Win32��� s advanced features, however, the source code must invoke the 32-bit Windows API functions, and should #include the windows.h file, which will in turn #include the appropriate 32-bit header files. The source code can also use standard C library functions.

For those familiar with the process of building applications and DLLs for Windows 3.x, there are some differences. Resources are linked along with object modules and libraries. You do not run the resource compiler to add resources to the executable file. Use CVTRES to convert a resource file to a linkable object file.


The Message Compiler, mc.exe, converts ASCII message text (.mc) source tiles into binary tiles containing a message table resource for inclusion in a resource script (.rc) file. The source-format supports multiple versions of the same message text, one for each national language supported, thus allowing support for multiple languages within the same image file.. Mc.exe automatically assigns numbers to each message, and generates a C/C++ include file for use by the application to access a message using a symbolic constant. For each Language statement, it generates a binary file containing a message table resource. It also generates a single resource script file that contains the appropriate Resource Compiler statements to include each binary output file as a resource with the appropriate symbolic name and language type.

Applications that perform event logging typically use an independent resource-only DLL that contains the messages, rather than carry the messages in the application image. This DLL is then specified as the source of message text for the events that it logs, when using the event logging APIs or

FormatMessage() to retrieve and use the message text.

The Win32 API is complex and it is essential that programmers routinely check the return value for each function invoked, and check error codes. Win32 functions return an expected result or tell you if an error has occurred; they don���t always indicate what the error was, e.g. CreateWindow() returns an HWND or NULL. However, the Win32 APIs do record errors on a per-thread basis, which can be obtained with GetLastError(),FormatMessage() allows the conversion of error codes, including those returned by GetLastError() into error strings. E.g.

LPVOID lpMessageBuffer;

FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), LANG_USER_DEFAULT, (LPSTR)&lpMessageBuffer, 0, NULL);

/* display this string */
LocalFree( (HLOCAL) lpMessageBuffer
Visual C++ 6.0 has a built in debugger which is very good! It supports Just In Time debugging which allows you to build your app for debug, run it and when it crashes VC++ will catch the error and jump to the source line that caused the problem.

Ntsd is a good deal less user friendly and allows debugging from a second machine. It is symdeb-like and accepts text-based commands to step through the debugging process. It supports multi-threaded debugging and also multi-process debugging. Both Ntsd and WinDbg are user mode programs, and allow source-level and machine-level debugging. At a later date, a remote debugging capability will be added to WinDbg, obviating the need for Ntsd.

Kd is a kernel mode remote debugger that runs on a separate NT hosted computer. It provides assembly language debugging of kernel mode code and is intended for system developers and device driver developers. It also supports multi-processor debugging. Ntsd and Kd share much of the same syntax. However Kd is not well suited to debugging user mode code; it does not provide support for threads, cannot set breakpoints in user mode code and cannot be used to examine paged-out memory.

The /DEBUGTYPE COFF flag must be used in the linker options to create debugging information for the Ntsd.exe and Kd.exe debuggers.

Windbg is another windows-hosted debugger similar to Visual C++.
An automated porting tool, Porttool.exe, comes with Visual C++ and assists in porting 16-bit applications to 32-bit applications. It parses source files and uses a table driven search facility to find and highlight non-portable program elements, describe the problem, and where appropriate, offers alternatives.

The Pview.exe process viewer allows the examination and modification of processes and threads running on the system. It indicates how much memory is being used, and how much of it is paged. It reports which processes and threads are using most CPU time. It allows the examination of how threads run at different priorities, and reports on thread status. It also reports thread API usage. Because Pview allows the modification of thread and process state, it has the potential for causing serious disruption to the system!

Spy++.exe is similar to that for Windows 3.x, and allows the monitoring of messages, and associated parameters, being transmitted around the system. It also allows monitoring of processes and threads.

Ddespy.exe, is also similar to that for Windows 3.x, and allows the examination of client and server DDE activity.

AnsiString Add

AnsiString demo;
demo=(ansiStrinng)"string1"+"string2";
ShowMessage(demo);

demo+="String"; //��航炊隤�瘜�