Getting Started Quickly ======================= The first thing to do is to install Clip-4-Win and to check it is working. Converting your existing applications comes last. 1. Installing Clip-4-Win ------------------------ You should use Windows to install Clip-4-Win. Run d:SETUP.EXE, where d: is the drive containing Disk 1. You need about 2MB free on your Windows partition and about 13MB free to install Clip-4-Win. Some of that space is recovered after the install. In the following, C:\CLIP4WIN is assumed to be the directory in which you've already installed the files. Note: there are some files specific to Clipper 5.2d (or 5.2e), and some that are specific to 5.3. These files are in the 52\ and 53\ directories. You need to build the libraries using the MAKELIBS.BAT file: MAKELIBS [d:dir] where is the Clipper version and d:dir is a drive/directory that can be omitted if your LIB environment variable can be used to find your Clipper libraries. For example, CD \CLIP4WIN MAKELIBS 5.2e Warning: instead of the following, you might prefer to copy the files to other directories. Check the names don't conflict with others you have already! Change your PATH, INCLUDE and LIB environment variables if you wish, or expect to specify paths. There is a batch file, SETC4W.BAT to help - see below! To let the Clipper compiler find the Clip-4-Win #include files, consider adding C:\CLIP4WIN\INCLUDE to your INCLUDE setting. To let the linker find the Clip-4-Win library, consider adding C:\CLIP4WIN\LIB to your LIB setting. To let DOS find the Clip-4-Win C4WBUILD.BAT file, consider adding C:\CLIP4WIN\BIN to your PATH setting. To let the linker find the Clip-4-Win "stub" file C4WSTUB.EXE, consider adding C:\CLIP4WIN\BIN to your PATH setting. (Some linkers do not use PATH to find the stub, so you may need to look at your linker's documentation.) You probably won't use the optional EXEMARK.EXE program, but if you want it to be found by DOS consider adding C:\CLIP4WIN\BIN to your PATH setting. To do the above: SETC4W [Clip-4-Win-dir] where should be either LINK or BLINKER, and the 2nd parameter is the directory where you installed Clip-4-Win (default C:\CLIP4WIN). Note: C4WBUILD.BAT (in CLIP4WIN\BIN) tries to build programs using the appropriate PRG, DEF, RC files and your choice of linker. It tests the environment variable C4WLINKER, which you can set to BLINKER if that's what you use. Also: if using MS-LINK, you can prevent errors using: SET LINK=/NOE This information is repeated below, in the hope you won't miss it... 2. Checking Clip-4-Win is Working --------------------------------- These tests rely on your environment variables PATH, INCLUDE and LIB being set correctly as described in part 1, or all the files being in the current directory. The supplied .RMK files are for MS LINK 5.30. For some versions of MS LINK you will have to add /NOE to the command line that runs LINK or use the DOS command: SET LINK=/NOE If you are using Blinker 3, a LINK command line of the form: link /se:600 obj1+obj2,,nul,clip4win,file.def can be replaced by blinker fi obj1,obj2 lib clip4win deffile file Please consult the Blinker documentation if you need more information. Also see the BLINKER\ directory. The C4WBUILD.BAT batch file will try to build a sample for you by looking for .RMK, .BLI, .MSL, .RC, .RES (etc.) files. It also tries to decide which linker to use; to make it use BLINKER use the DOS command: set c4wlinker=BLINKER Note: the meaning of a menu selection like File | Run is to select the File menu item, and then the Run item from the File menu. When compiling the samples, don't forget the /n option (which is a standard Clipper compiler option you may want to use with DOS Clipper programs as well). You are recommended to use the supplied rmake (.rmk) files. 2.1 Trying the HELLO sample --------------------------- Start with the simplest program. At a DOS prompt type: cd \clip4win\source (change \clip4win if you installed elsewhere) c4wbuild hello If it doesn't compile and link without errors, check: o the linker you are using is suitable (maybe you have more than one version of LINK and your PATH setting means the wrong one is being used) o the linker command line or LINK envirnment variable (e.g. maybe you need /NOE) o the version of clip4win.lib supports the version of Clipper you're using (e.g. maybe you're linking the 5.2 version of clip4win.lib but using the 5.3 Clipper compiler) When you have a hello.exe that compiled and linked without errors, switch to Windows, and either use Program Manager's File | Run menu or in File Manager double click on the file (or highlight it and press ENTER). You should get a message box (a kind of window) with a title saying Hello from Clip-4-Win the message inside the window should be Hello World! and there should be an OK button at the bottom of the window. You should be able to switch between the message box and other applications such as Program Manager e.g. using Alt-Tab or by clicking with a mouse. You should be able to exit the hello program in any of the standard Windows ways (e.g. Alt-F4 or End Task from the Task List) or by pressing the OK button. 2.2 Trying the WINEXEC (RUN) sample ----------------------------------- WINEXEC.PRG shows how easily programs can be run. In your SOURCE directory, type: c4wbuild winexec then switch to Windows and run the new WINEXEC.EXE. Depending on how you set up your Windows, you should be able to run some or all of the programs on the Run menu. You can choose Help | Program Source to view the source code. 2.3 Trying an Object Oriented (OO) sample ----------------------------------------- To check the libraries for the Clip-4-Win Application Classes and the TopClass class-creation system (C4WCLASS.LIB and TOPCLASS.LIB) are installed and working, type: cd oo (in the SOURCE directory) c4wbuild tinybrow This is a small DBF browser. You should be able to see the main window's status bar updating as you navigate the menus. To browse a DBF choose File | Browse... There's a *much* better browser, WBrowse, that's used in the tutorials. Look at wbrowset.hlp sometime. Also, refer to the documentation about Converting Browsers in CONVERT.TXT. 2.4 Trying the DEMOMULT sample (optional) ----------------------------------------- NOTE: If you have the Evaluation Version of Clip-4-Win you probably do not have the files required for this sample! This is to save disk space and to encourage you to buy the full product. To complete the check for correct operation of Clip-4-Win with your Clipper and linker: cd dbrowse (in the SOURCE directory) rmake /dNORC br cd .. (back to the SOURCE directory) If you have BLINKER: rmake /dBLINKER demomult otherwise: rmake demomult There are many menu options, including a TBrowse in a window that's mouse-aware. You might try the Insert and Delete keys, which add and remove columns. Warning: if you change a field your DBF file is updated! Note: demomult takes advantage of the public domain ntxpos/ntxrec functions. These are not part of Clip-4-Win, but are certainly useful. As their names show, they are ONLY for NTX files. Believe it or not, some people have been known to complain that Clip-4-Win doesn't work because of problems using (or misusing!) these functions. 2.5 Learning more ----------------- The Non-OO Tutorial and the OO Tutorial both introduce many aspects of Clip-4-Win, and refer to more samples you can build and run. You might like to follow them next. In any case, please see "Detailed Conversion Information" below. 2.6 Trying the ADDMGR, PADDING, PUBNEWS, USERS and USERSRES samples ------------------------------------------------------------------- Not now! Look at the README.* files later. NOTE: If you have the Evaluation Version of Clip-4-Win you probably do not have all the files mentioned above. This is to save disk space and to encourage you to buy the full product. 3. Object Orientation - Or Not? ------------------------------- You can use Clip-4-Win with or without Object Orientation (OO), but how do you decide? (a) Try the OO Tutorial. You'll see some sample code, and some of the abilities of TopClass and the Clip-4-Win Application Classes. (b) Explore the performance of your target systems: are they going to be fast enough for OO? There's a definite "hit", especially with late- binding, as used in Clipper. (c) Look at the samples in SOURCE\OO\, SOURCE\OO\CMD\, SOURCE\OO\USERS, and SOURCE\OO\USERSRES. The SOURCE\OO\CMD directory has various stages of the evolution of a simple browser, from command-based syntax to a more OO style. The SOURCE\OO\USERS and SOURCE\OO\USERSRES directories contain some of the code discussed in the OO tutorial. SOURCE\OO\BROW.PRG and BROWMDI.PRG are also discussed in the tutorial section. A quick visit to the PRG's in SOURCE\OO: o DDECLIEN.PRG and DDESERVE.PRG show a DDE client and server o BROW.PRG and BROWMDI.PRG are browsers o MDIBARS.PRG uses toolbars and status bars o MDIBITMA.PRG is an MDI bitmap viewer o MDIMENUS.PRG shows how different menus can be used o MDIWBROW.PRG shows WBrowse(s) in an MDI application o ODBCBROW.PRG is an MDI ODBC browser, using BListBox in an MDI dialog o ODBCWBRO.PRG is an MDI ODBC browser, using WBrowse(s) o PBAR.PRG is a progress bar sample o TOOLBDLG.PRG shows a toolbar implemented using a dialog (if you want a feature-rich bar this is one way) Currently, Clip-4-Win is compatible with at least the following class creation systems: Class(y), HighClass, OClip, TopClass. 4. Coverting Your Applications ------------------------------ In a sense this isn't very sensible: your existing code is not likely to be event-driven, and it is not going to be expecting the events that occur under Windows. But DON'T despair!! You can probably keep 70%-90% of your code. Don't start with the unrealistic expectation that your program will immediately compile, link and behave like a true Windows application, that's all! You should start with a small, simple application. Adapt one of the supplied .RMK files, or use one of your own. ALWAYS try to use /N /W with the Clipper compiler, and eliminate all warnings. Consider using /ES2 with the Clipper compiler. 4.1 Detailed Conversion Information ----------------------------------- Please see CONVERT.TXT for a great deal of information about converting your current DOS Clipper code and knowledge to Windows. CONVERT.TXT also contains samples of typical DOS Clipper code and the equivalent Clip-4-Win code. As well as CONVERT.TXT, there are tutorials in the manuals, including a lengthy tutorial on Object Orientation. 4.2 Using APP.PRG ----------------- Rather than making the changes to your MAIN() function described in CONVERT.TXT, you may prefer to start with the SOURCE\APP.* files, and add pieces of your application as you go along. Please make sure you've read CONVERT.TXT thoroughly. APP.PRG contains a lot of "standard" elements of a Windows application: o main window, with title and borders o menu o toolbar The source file contains instructions to help you. Remember: "You should start with a small, simple application." 5. Last Words ------------- You almost certainly need to link CLIP4WIN.LIB after any RDD's, but before the other Clipper libraries. I'll say it yet again (!): You need the /NOE option with some versions of Microsoft LINK.