MV1000 Application Notes


MV-1000 SDK - Compilers, Libraries and Operating Systems

This Application Note considers the compatibility and special conditions required to compile sample programs provided with the different MV-1000 Software Developer's Kits (SDK).

Specifically, it discusses software running under DOS, Windows( 3.1, Windows95, Windows NT and OS/2. Compilers and development environments include Watcom C, Microsoft C and Borland C.

Five different SDKs are available from MuTech. The libraries they include are:
1) A 32-bit library (mv1.lib) for running in DOS with DOS4GW extender. (MVLIB)
2) A 16-bit DLL (mv1app.dll) for running under Windows 3.1. (MVDLL)
3) A 32-bit DLL (mv1app95.dll) for running under Windows 95. (MVDLL95)
4) A 32-bit DLL (mv1appnt.lib) for running under Windows NT (iNTEL). (MVDLLNT)
5) A 32-bit DLL (mv1appos.lib) for running under OS/2. (MVDLLOS2)

Compiler/Development Environment
Watcom 10.0MicrosoftBorland IDEVisual Age
Visual C/C++Developers Studio
DOS 5.0 or laterSupported 1Not Supported 2Not Supported 3Not Supported 4Not Supported
Windows 3.x 3.0 or laterSupported 5Supported 6Supported 7Supported with restrictions 8Not Supported
Windows 95Untested, Should work 9Supported Version 2.0+ 10Supported 11Currently not Supported 12Not Supported
Windows NT 3.5 or laterUntested, Should work 13Supported Version 2.0+ 14Supported 15Currently not Supported 16Not Supported
OS/2Not SupportedNot SupportedNot SupportedNot SupportedSupported 17


The Operating Systems

Each of the operating systems have different requirements on the files and locations which must be specified for proper execution of the .exe programs.

DOS:
Programs written to use the MV-1000 under DOS must be built using the Watcom compiler/linker. Because they use a static LIB for linking, there are no run-time library requirements. They must be compiled and linked in 32-bit address mode and use the DOS4GW extender. The DOS4GW extender may be placed either in the same directory as the executable file (.exe) or in a directory in the PATH.

Windows 3.x:
Programs written to use the MV-1000 under Windows 3.x may be built using Watcom compiler/linker, Microsoft Visual C/C++ or Borland IDE. They should be built for large-mode, 16-bit addressing. The 16-bit mv1app.dll should either be placed in the same directory as the executable or in a directory in the PATH.

Windows 95:
Programs written to use the MV-1000 under Windows 95 may be built using Watcom compiler/linker, Microsoft Visual C/C++ (version 2.0 or later), Microsoft Developer's Studio or Borland IDE. They may built for 16-bit addressing which will require a 16-bit addressing mv1app.dll, but generally should be built for 32-bit addressing. Then, 32-bit mv1app95.dll should either be placed in the same directory as the executable or found in the PATH. A driver file, mv1dll.386 must also be in the current directory or found in the PATH.

DIB displays faster than Windows 3.x. DCI callback functions do not work properly so active video windows continue to display at the top of the window stack.

Windows NT:
Programs written to use the MV-1000 under Windows NT may be built using Watcom compiler/linker, Microsoft Visual C/C++ (version 2.0 or later), Microsoft Developer's Studio or Borland IDE. They should be built for 32-bit addressing. The 32-bit mv1appNT.dll should either be placed in the same directory as the executable or found in the PATH. You must have a driver, mv1drive.sys in the \WINNT\SYSTEM32\DRIVERS directory (assuming WINNT to be the top directory of Windows NT installation). You must also have registered the driver in the "HKEY_LOCAL_MACHINE on Local Machine" as directed in the README.D file included in the M-Vision 1000 Video Digitizer Windows NT Distribution Disk. DCI not functional in Windows NT.

OS/2 WARP:
Programs written to use the MV-1000 under OS/2 WARP version 3 should be built using Visual Age. They should be built for 32-bit addressing. The 32-bit mv1appos.dll should either be placed in the same directory as the executable or found in the PATH. The driver file, MV1OS2.SYS (normally found in \MV-1000\DRIVER), must be referenced by DEVICE=C:\MV-1000\DRIVER\MV1OS2.SYS in the CONFIG.SYS file.

The Development Environments

Watcom:
The Watcom compiler and linker are normally started by the WMAKE utility running under DOS. The following directory paths assume that the Watcom environment is stored under c:\WATCOM. The PATH should include "C:\WATCOM\BIN;C:\WATCOM\BINW; C:\WATCOM\BINW". You should also include the following SET commands in the AUTOEXEC.BAT:

SET WATCOM=C:\WATCOM
SET EDPATH=C:\WATCOM\EDDAT
SET INCLUDE=C:\WATCOM\H;C:\WATCOM\H\WIN

An example make file is provided for some SDK (dsample.mak for DOS and wsample.mak for Windows 3.x). The LIBRARY path in the sample make file must point to the directory containing MV1app.lib, under the default installation this will be \MV-1000\LIB. The INCLUDE path must point to the directory containing mv1.h and portable.h (..\..\inc is used in the sample make files). You may specify INCLUDE and LIBRARY paths as command line options.

Microsoft Visual C/C++:
The Visual C/C++ may be used in two different ways. In either case, the system environment must point to the correct directories. The following directory paths assume that the Visual C/C++ environment is stored under c:\MSVC. In the PATH, you should include "C:\MSVC\BIN". Other directory locations are either specified in the options or in the MAKE file.

NMAKE is available under DOS. Instructions on the proper command line are given in the sample 'c' code or in the make file- MSC.MAK for Windows 3.1, CSAMPLE.MAK for Windows95 or NSAMPLE.MAK for Windows NT.

To use the Visual C/C++ version 1.5 program to create a new Windows 3.1 application program project or make file, you follow these steps:

1. Under the Project menu, choose New. Then, type the desired project name. The Type should be Windows Application (.EXE).
2. Next, you will enter the Edit project window. Here, you add the .c and .rc files you need. You may add .def files or the system will prompt you for default creation later. You do not need to add .h files, since they will be pointed to by the .c and .rc files. After you have added all relevent programs, you should Close.
3. Then, under Project, choose Close to close the new make file.
4. Under File, choose Open and specify the .mak file you just created.
5. Find and remove any dependencies that reference x11 such as x11\xlib.h, x11\x.h, x11\intrinsi.h and x11\stringde.h. There may be none to eliminate.
6. Save the updated .mak file and Close it.
7. If you are using one of the sample .c programs supplied by MuTech, open the .c file and add a line: "#include " .
8. Under the Project menu, choose Open and specify the new .mak file.
9. Under the Options menu, choose Project. In this window, first choose Compiler and set the following values:
a). CPU - 386
b). Struct Member Alignment Byte - 1 Byte
c). Custom Options: Other - /Zp1 /GAs /GEd
d). Memory Model - Large, Seg Setup - SS==DS *
10. Return to the Options/Project window and select Linker.
11. Under the Linker Input Libraries entry add mv1app.
12. Return to the Main menu and, under Options, select Directories. Ensure that the Include Files Path contains the directory which includes mv1.h and portable.h. Ensure that the Library Files Path contains the directory which includes mv1app.lib.
13. Now, you may select Build under the Project menu. However, if you did not previously add a .def file to the .mak, you will be prompted to add a default definition file and edit it. You may just accept the default and close it. Then, Build once again.
14. At this point, you have an executable sample program.

To use the Visual C/C++ version 2.0 program to create a new Windows 95 or Windows NT application program project or make file, you follow these steps:
1. Under the File menu, choose New. Choose project. Then, type the desired project name. The Type should be Application. Follow this with the Create button.
2. Next, you will enter the Edit Project window. Here, you add the .c and .rc files you need. You do not need to add .h files, since they will be pointed to by the .c and .rc files.
3. Under the Project menu, choose Files. Add either mv1app95.lib or mv1appnt.lib (found under \MV-1000\lib after default installation), depending on the target operating system.
4. Then, under Project, choose Build to create the new application program.

Microsoft Developer's Studio:

To use the Microsoft Developer's Studio C/C++ version 4.0 program to create a new Windows 95 or Windows NT application program project or make file, you follow the following steps:
1. Under the File menu, choose New. Choose Project Workspace. Then, type the desired project name. The Type should be Application. Follow this with the OK button.
2. Next, you enter FileView in the Edit Project window. Under the Insert menu, choose Files into Project. Now, you add the .c and .rc files you need. You do not need to add .h files, since they will be pointed to by the .c and .rc files. Also, add either mv1app95.lib or mv1appnt.lib (found under \MV-1000\lib after default installation), depending on the target operating system.
3. Then, under Project, choose Build to create the new application program.

Borland IDE

The Borland Integrated Development Environment (IDE), version 4.51, uses project files (*.ide) rather than .mak files as Microsoft development environments do. These projects should be created through the IDE. To create a new project environment for Windows 3.1:
1. Choose New under the Project menu. In the New Target window, specify the name of the project and the path. Ensure the Type is Application (.EXE), the Platform is Windows 3.x (16) and the Target Model is Large. Also, the OWL and dynamic buttons should be already selected. Enter the Advanced screen and choose No Source, then click off .rc and .def. Ok your way back to the main menu.
2. Use the Insert button on the keyboard while the project in the project window is selected. Add the .c, .rc, and .lib files to the project. Ensure they are all directly linked to the project, not each other (they can be dragged to where they belong).
3. Under the Options menu, choose Project. In the Directories window, add \MV-1000\INC to the Include list and add \MV-1000\LIB to the Library list.
4. Under the Options/Project menu, in the 16-bit Compiler/Entry/Exit Code window, you need to check either "Windows all functions exportable" or "Windows explicit functions exported".
5. Load the C file that you will build. Find the function prototype for WindowProc. Make sure that the second paramter is unsigned, not WORD. Also, add the directive #include near the beginning of the program where the other include directives are found.
6. If you are using linescan.c, you will need to add a function prototype for CalculateXY().
7. Now, under the Project menu, choose Build All to create your working application program.
8. To run the program, you need to have mv1app.dll in the directory that the .ide file is in. (It may be the Borland BIN directory.)
9. Certain functions that return float or struct values, such as MV1GetOffset() and MV1GetGain(), require special "wrapper" functions to handle a different passing convention than used by Microsoft or Watcom. Refer to the Windows Developer's Journal, July 1996 pages 37-39, for details.

OS2:

The Visual Age compiler should compile the sample programs as specified in the .c sample programs.



1 - Requires DOS4GW extender (provided with SDK).
2 - Not planned.
3 - Not planned.
4 - Not planned.
5 - Requires DOS4GW extender (provided with SDK); Compiled under DOS using wsample.mak.
6 - May be compiled under DOS using msc.mak or under Visual C/C++ environment; requires special compiler switches.
7 - Requires 16-bit Windows libraries installed in the Developer's Studio.
8 - Should use the Integrated Development Environment, not DOS. Functions that require return values of float or struct need special handling. Stricter type checking generates many warnings.
9 - Might work, never tested.
10 - Must use version 2.0 or higher. Needs to run under Windows95 or WindowsNT. Example csample.mak file provided for compiling under DOS window. Can create new make files for Visual C/C++ environment.
11 - Needs to run under Windows95 or WindowsNT. Example csample.mak file provided for compiling under DOS window. Can create new make files for Visual C/C++ environment.
12 - Special Borland library planned.
13 - Should work, no sample make files.
14 - Must use version 2.0 or higher. Example nsample.mak file provided for compiling under DOS window. Can create new make files for Visual C/C++ environment.
15 - Example nsample.mak file provided for compiling under DOS window. Can create new make files for Visual C/C++ environment.
16 - Special Borland library planned.
17 - The only compiler tested. Used for creation of MV-1000 libraries.



MuTech Corp. Sept 1996
Return to MuTech Homepage