Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating a Dialog-Based Comet Windows Program Brian Levantine.

Similar presentations

Presentation on theme: "Creating a Dialog-Based Comet Windows Program Brian Levantine."— Presentation transcript:

1 Creating a Dialog-Based Comet Windows Program Brian Levantine

2 Tools you’ll need Ultra Edit – Programmer’s Text Editor Microsoft Visual Studio.NET (VS) – Resource Editor/DLL Compiler Visual Studio Project Generator – DPBuild.Exe COSD – Comet Symbolic Debugger

3 Ultra Edit – Text Editor Configurable tools Syntax highlighting Auto-indent File compare Error location Cheap!

4 COSD – Symbolic Debugger Symbolic Steps through code Breakpoints View/Modify variables Debug messages Background partitions

5 MS Visual Studio.NET Editing resources Generating Dynamic Link Library Robust help (if you use it) We are NOT programming in C++, C#, or VB

6 VS Project Generator – DPBuild.Exe Generates a ready-to-use Visual Studio Project Allows the user to specify the project filename and folder Will create the project folder if it doesn’t already exist

7 The components of a Comet Windows program VS (Visual Studio) Project files –Usually located in a folder directly below IB source files –Generates a binary DLL file containing resources that will be loaded and used by a IB program -.dll –Generates a text “include” file that should be included in any IB source file that references resources within the DLL IB Source files –Include file generated by VS – must be registered in Comet QDIR –Generated Comet.OBJ file

8 What is a Resource? A Resource is a discard-able non-program object that can be individually loaded from a DLL or EXE file for use by a program. When the program is done with the resource it can discard it from memory to conserver space. Some common resources are: –Dialog boxes –Bitmaps –Icons –Menus

9 What is a DLL? A DLL (Dynamic Link Library) is a file that contains compiled binary information consisting of program code and or program resources A DLL can (and usually does) contain many resources for use by any program that requires them. For Comet programs, a single DLL may contain all of the Dialog boxes for an entire application or for a single module.

10 Why use Dialogs and DLLs? A dialog box provides the simplest and fastest way to write code for and load a form. With few exceptions dialogs can provide all of the features necessary for a good user experience. A DLL provides a convenient mechanism for storing many dialogs in a single file. The file can then be downloaded to a CometAnywhere client to display any forms at maximum speed.

11 What are Controls? A Control is a child window, usually placed into a dialog box, that has a specific appearance and pre-defined behaviors. Some common controls are: –Edit- ListView –Radio Button- TreeView –Checkbox- Textbox –Pushbutton- Picture –Listbox- Tab

12 Building your first Dialog Be sure all of the aforementioned tools have been properly installed on your system before beginning this exercise Don’t be intimidated by the VS IDE (Integrated Development Environment). It’s easy to start again if you mess up. Don’t be afraid to experiment Be patient with me. If you haven’t yet figured it out, I don’t know it all!

13 Step 1 – Create your project Run DPBuild.Exe –Specify the 8 character project filename and the project folder location Note that the specified location will have the appended to it so that the resulting project folder will have the same name as the project. The generated project will expect it’s folder to be located one level below your IB source folder. The two output files:.dll will be copied up to the parent folder. Once a project has been created it is possible to manually modify the output location. Press the “Generate” button to build your new project. Answer “Yes” to the “launch the project now?” question

14 Step 2 – Create a dialog Choose “Resource View” from the “View” menu or press Ctrl+Shift+E. In the “Resource View” window right click on the icon identified as.rc and choose “Add Resource”. In the “Add Resource” window choose “Dialog” and press the “New” button. Choose “Properties Window” from the “View” menu or press F4. Set “Visible” property to True. Click to the right of ID and give the new dialog a new identifier name: IDD_. Click to the right of the “Caption” property and enter a new dialog title and press tab.

15 Step 3 – Add a Static text control Choose “Toolbox” from the “View” menu or press Ctrl+Alt+X. In the “Toolbox” window select and drag a Static Text control onto the new dialog. In the “Properties” window click to the right of the “Caption” property and enter some text and press tab.

16 Step 4 – Compile your project Choose “Build ” from the “Build” menu or press Alt+F7 You should now find two new files in the project’s parent folder. –.dll is the compiled output file containing your dialog. –.inc is a text file that contains all of the symbolic constants used in the DLL in Internet Basic format (Set statements).

17 Step 5 – Register the include file with Comet Double click to open file in UltraEdit. Start Comet if it is not already running. Make sure the folder is already accessed by Comet. If not then stop and use Comet to create (if required) and access the QDIR. Click on the “Register File” toolbar icon to register (add to QDIR) the file for access by Comet.

18 Step 6 – Create IB source file Copy DlgTemp.Ibs from the DLG folder or HowTo1.Ibs from the HowTo folder into your program source folder and rename it to a filename other than.ibs. Choosing a name other than.ibs will prevent a conflict with the compiler’s intermediate filename. Open the file with UltraEdit and register the file with Comet.

19 Step 7 – Modify the IB source to execute your new dialog Change include filename Change DLL name to.dll. Change dialog ID to IDD_ Compile the IB source. Run the program.

Download ppt "Creating a Dialog-Based Comet Windows Program Brian Levantine."

Similar presentations

Ads by Google