setup00.txt 0.02                     UTF-8                    dh:2006-11-13

                       INITIAL JNI DEVELOPMENT SETUP TEST

The info/odma/odmjni100/test/setup00 folder is used to verify that JNI
operation and compiling is working properly.

The environment is established using the scripts odmjni100/OdmJava.bat and
odmjni100/OdmJNI.bat.  The first is for Java-only compiling, the second is
for Java and VC++ compiling with all of the necessary Windows and Java
libraries and include files.  The scripts OdmVC++.bat and OdmPSDK.bat are
used as subordinate scripts to OdmJNI.bat.

The procedure is as follows:

1. Unzip the materials into <folder>.  The classpath location for the ODMJNI
   folder hierarchy is a good choice.

2. Extracting the full archive with directories will place material in

        <folder>\info\odma\odmjni100\test\setup00\

2. Review the <folder>\info\odma\odmjni100\OdmJava.bat file for proper
   operation on your computer.  There are two environment variables that
   must be set at the beginning of the file.  The third variable is
   probably all right as it is.

3. Review the <folder>info\odma\odmjni100\OdmPSDK.bat file for proper
   location of the Windows Platform SDK on your computer.

3. In a console session, change to directory

      <folder>\info\odma\odmjni100\test\setup00

   Perform RunSetup00.bat in that location.

   You should see Setup00 run, with console output.  All of the output
   is produced by a native method implementation.  None of the output
   is produced directly from Java.

4. Operation of RunSetup00.bat on your computer demonstrates that the
   Setup00.dll has no dependencies on libraries not already on your
   computer.  It is limited to the i86 Win32 Windows platform, but there
   are no additional files that need to be installed along with it.

5. You can recreate the Setup00.class by running script BuildClass00.bat.

6. You can recreate the Setup00.dll by running script BuildDLL00.bat.

7. The file Setup00.h is an annotated version of the file that was
   produced by performing

        javah -jni Setup00

   It is not necessary to reproduce this file.  Just use the Setup00.h
   file that is included in this package.

EXPERIMENTS

A number of experiments were performed before arriving at this version.

1. There is no impact by changing optimization or other settings when
   compiling this program.

2. Using compiler option /MD instead of the default /MT will lead to a
   much smaller DLL.  However, it is then necessary to redistribute the
   Microsoft Common Run Time DLL and deal with side-by-side deployment
   and other considerations.  The approach for ODMJNI is to make the
   DLL(s) completely self-contained, and then work to ensure that no
   extraneous library code is employed.

3. I wanted to turn off space for manifests to see if that would shrink my
   DLL: ttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=918677&SiteID=1
   There seems to be no difference in this case.

4. I want to use the Windows Console functions instead of <stdio.h> and
   see how much more compact the DLL can be made.  This is also more in
   line with any logging that will be done during debugging and production
   of exception notices.
     4.1 I first changed the hello() program to use a single string
   constant instead of multiple fputs operations.  That apparently made
   no difference whatsoever.  The DLL is still 53,248 bytes.
     4.2 I then eliminated all dependency on <stdio.h> and worked with
   <windows.h> and Windows Console functions.  The output happened
   perfectly and the DLL shrank to 49,152 bytes.
     4.3 This code also makes some effort to discover the console and to
   create one if there is none available to the current process.  One of
   these should work when we want to make console output from underneath
   a Java-based Windows application.  This may also give us a Windows
   handle that we can pass to DMS integrations for their dialog purposes.


0.02 2006-11-13-16:11 Reflect additional experiments with Setup00.c to
     avoid using <stdio.h> and using Windows Console functions instead.
0.01 2006-11-12-19:15 Cleaned-Up version for stable Setup00.c 0.02 with
     expanded output information.

$Header: /MyProjects/java/ODMdev/info/odma/odmjni100/test/setup00/setup00.txt 4     06-11-13 18:15 Orcmid $

                          *** end of setup00.txt ***