Step 2:

Application developed with Microsoft Visual C++, Part 2.


3rd Step
, Add the 1st list of controls to IDD_TESTVC0_DIALOG dialog.



Declaration step ...
  • Database operations - to display any record of the database file, KJV.mdb.
  • List of controls to be add: three Pictures (Bitmap), two Pictures (Frame), eight Static Texts, six Push Buttons and one Edit Box (MultiLine).

Details ...

The IDD_TESTVC0_DIALOG dialog design, part 1.

Learn how to write a Visual C++ application ...


Note:
For Visual C++ projects, use the Dialog editor window to create or edit dialog boxes.
A DAO database object, represented in MFC by class CDaoDatabase.
A CDaoDatabase object represents a connection to a database through which you can operate on the data.
CDaoDatabase accesses data through a Data Access Object (DAO) based on the Microsoft Jet database engine.
A CDaoRecordset object represents a set of records selected from a data source.


  1. Add files ...
    • From the ...\VC App\res folder copy the file - diam1.bmp (Bitmap Image)  to the folder C:\TestC\Test VC0\res.
    • From the ...\VC App folde,  copy the file - KJV.mdb to the folder C:\TestC\Test VC0 and remove the read-only attribute of the file C:\TestC\Test VC0\res\KJV.mdb - (if exist).
  2. Graphics ...

    For Visual C++ projects, use the graphics editor to edit graphical images, including bitmaps, icons and cursors.
    1. Modify the Icon - ID : IDR_MAINFRAME :
      Select and double-click the IDR_MAINFRAME Icon resource. In the Image Editor Window appears, draw the character - B.

      Icon before   Icon after
       

      From the File menu, click Save.

    2. Import the Bitmap file - diam1.bmp - TestVC0 resources.
      • Select TestVC0 resources. From the right mouse pop-up menu, click Import.
      • In the Insert Resources dialog box, select the file diam1 in the folder
        C:\TESTC\TestVC0\res and then click Import.

        Note:
        In theTestVC0 resources
        , new folder - Bitmap and new item appear.
      • Select IDB_BITMAP1 of the Bitmap folder. From the right mouse pop-up menu,
        click Properties.
      • In the Bitmap Properties dialog box, modify the data:
        The old value The new value
        ID: IDB_BITMAP1
        ID: IDB_DIAM1

        From the File menu, click Save.

    3. Create the New Bitmap files - TestVC0 resources.
      1. Create the new Bitmap file - The data.bmp:
        • Select TestVC0 resources. From the right mouse pop-up menu, click Insert.
        • In the Insert Resources dialog box, select Bitmap Icon and then click
          New.

          Note:
          New Bitmap item appears.
        • In the Bitmap Window appears, draw the word: The data.
        • Select IDB_BITMAP1 of the Bitmap folder. From the right mouse pop-up
          menu, click Properties.
        • In the Bitmap Properties dialog box, modify the data:
          The old values The new values
          ID: IDB_BITMAP1
          File name: res\bitmap1.bmp
          ID: IDB_THEDATA
          File name: res\The data.bmp

          From the File menu, click Save.

      2. Create the new Bitmap file - search.bmp:
        • Select TestVC0 resources. From the right mouse pop-up menu, click Insert.
        • In the Insert Resources dialog box, select Bitmap Icon and then click
          New.

          Note:
          New Bitmap item appears.
        • In the Bitmap Window appears, draw the word: Search.
        • Select IDB_BITMAP1 of the Bitmap folder. From the right mouse pop-up
          menu, click Properties.
        • In the Bitmap Properties dialog box, modify the data:
          The old values The new values
          ID: IDB_BITMAP1
          File name: res\bitmap1.bmp
          ID: IDB_SEARCH
          File name: res\search.bmp

          From the File menu, click Save.

  3. Modify the Dialog Properties - .IDD_TESTVC0_DIALOG:
    Right click the Dialog and click Properties on the shortcut menu to open the Dialog Properties dialog box.
    a- The old Dialog Properties:
    General tab
    * ID:
    * Caption:
    Styles tab
    * Style:
    * Border:
    *
    boxes checked

    IDD_TESTDLGVC_DIALOG
    Learn how to write aVisual C++ application ...

    Popup
    Dilog Frame
    Title bar, System menu


    b- The new Dialog Properties:

    General tab
    * ID:
    * Caption:
    Styles tab
    * Style:
    * Border:
    *
    boxes checked
    More Styles tab
    *
    boxes checked

    IDD_TESTDLGVC_DIALOG
    Learn how to write aVisual C++ application ...

    Popup
    Dilog Frame
    Title bar, System menu, Minimize box

    Visible, Center


  4. Add controls ... (Next page ------->)

Previous
Home 2 Home
Next