
RELEASE NOTES
-------------

This README describes some specific details for running MICO under
Windows using the Visual-C++ compiler from Microsoft. Beware that the
port isn't finished yet(but hopefully very close to completion).


PREREQUISITES
------------

You will need Visual-C++ 5.0 Service Pack 3 or (preferred) Visual-C++
6.0 Service Pack2 to compile MICO for Windows. Note that without
Service Pack 3 (Microsoft terminology for bug fixes), you won't be
able to compile the sources. You don't need flex and bison; the MICO
sources already contain the files generated by these tools.

VC++ 5.0 SP3 is available from:
http://www.microsoft.com/msdownload/vs97sp/full.asp

VC++ 6.0 service packs are available at:
http://msdn.microsoft.com/vstudio/sp/default.asp

Some notes for Windows95: I had to install the WinSock2 library to
make things work under Windows95. You can download WinSock2 from the
Microsoft server for free:

http://www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetworkingtools/w95sockets2/default.asp?site=95


IMPORTANT: You also need to make sure that the environment variables
are set properly for Visual-C++. There is a batch file called
VCVARS32.bat that does this. Be sure to run before you try to compile
MICO.


HOW TO INSTALL THE SOURCES
--------------------------

Unzip the files at any location. You do not need to run the configure
script (which would be pretty useless anyway).


HOW TO COMPILE
--------------

Change to the directory where you have unzipped the MICO sources edit
the file MakeVars.win32 and set the SRCDIR to the location of the mico
directory(no trailing backslash) We apologize for the inconvenience.

Then do the following:

Under NT:

   nmake /f Makefile.win32

Under Windows95/98 type:

   nmake /f Makefile.win32 w95-all

this will build all the necessary DLLs and executables in a
subdirectory called "win32-bin", which will be created during the make
process. The content of this directory is the only thing you need for
building MICO applications. You can move it to your preferred
location. The build will require around 150MB (the demo directory
another 90MB).

You should modify the PATH environment variable to include
this directory. If, for example, the MICO sources were unzipped in
C:\temp\mico, then type the following:

PATH C:\temp\mico\win32-bin;%PATH%

Take a look at mico\demo\mfc\README to see an example that uses MICO
in conjunction with the MFC class library.


USING MICO IN THE VISUAL C++ IDE
--------------------------------

You can use MICO in a regular VC++ project. First you have to tell
Visual C++, where MICO is located. You do this in the Tools/Options
Dialog, in the Directories tab, you have to set the include path to
the following directories(assuming you have installed MICO on drive
D):

  d:\mico\win32-bin\include\windows
  d:\mico\win32-bin\include

These lines have to be first in the list(use the move buttons).

The libraries path has to be set to: (order does not matter)
  d:\mico\win32-bin\lib

The executables path accordingly to:
  d:\mico\win32-bin\

In the project settings you have to make the following changes:
Compiler:
  You have to define _WINDOWS in the Preprocessor options.
  In the Code Generation options you have to use the Multi-Threaded Dll 
  version of the runtime library, because that is the way MICO 
  was compiled.
Linker:
   You have to add micoXXX.lib and wsock32.lib(where XXX ist the
  current MICO version without dots) to 'Object/Library modules' input
  field (Hint: Before you do this select 'All configurations' in the
  upper left combo box named 'settings for')

Additionally you can integrate your IDL-Files in the build process. 
First you have to add the idl file to your project, then goto
Project/Settings and select this file, or right click on the idl file
and choose Settings, select the Custom Build tab and enter:

  idl --c++-suffix=cpp [other options] $(InputPath)

into the Build Command listbox.

In the Output files list box enter
  $(InputName).h
  $(InputName).cpp

For inserting $(..) you can also use the popup buttons at the bottom
of dialog, or you can use the real filename instead. By the way, the
output files of the idl compiler are created in the current directory,
normally the root of the project. Now you have to add filename.cpp to
the project you can do this, even before the file exists, by entering
it in the file dialog or you can first create it by manually selecting
compile in the context menu of the idl file.

Don't forget the c++-suffix=cpp option, the default is the .cc suffix
and visual won't treat this as c++ source files(would have been better
to set the default to cpp on Win32 but changing it now would break too
many makefiles).


PROBLEMS
--------

Porting MICO to Visual-C++ was a major pain. Sometimes a MICO
application will crash inside mico.dll. As far as we can tell this is
related to a bug in the Microsoft Linker when dealing with global
constructors. If this happens to you, try to link typecode.obj and
util.obj statically with your application (a copy of these object
files can be found in win32-bin\lib). This usually resolved our
problems...  sigh...

 Normally no need to link any additional files.
 The util.obj is only needed when passing std::map objects between
 application and a dll(necessary in idl.exe).
 The problem with typecode.obj should be fixed too(knock on wood).

Most of the demos now have a makefile for VC++ and a batch file.
The presence of these, does not mean that all the examples work, most of
them have been converted automatically. In some cases, not everything
is ported to win32, in other cases the compiler can't handle the code.
Sometimes micod or a server keeps on running, after an example
ends(you have to close the console, or  when the process is not
started with a separate console(start /b), you have to kill the process
from the tasklist).

Especially for compiling single demos, a small batch file placed
somewhere in the path(for example named make.bat, unless you 
already have a make.exe ), that looks like:

nmake /f makefile.win32 %1 %2 %3

is quite helpful, so that you can compile, just by
typing make(or 'make clean' to remove the object files )

TODO:
- nsadmin has strange input handling
- demo/relship won't compile


Visual C++ 5 SP3 contains a SERIOUS BUG in the std::string class,
using VC6 is recommended!


If you have problems with the dll-version, here is a guide
from Roland Koeckel <roland.koeckel@gmx.de> how to use
MICO in a static library:

How to compile mico as a static library with VC++ 6.0 SP1

1.) VC++ and *.cc files

Making VC++ recognize *.cc files as C++ files is a major
hazzle. I am tempted to say this has been done on purpose.
But in case you want to compile mico in the Developer
there is no way around:

http://support.microsoft.com/support/kb/articles/Q181/5/06.asp

Everybody not willing or able to use regedit feel free to
use the following registry file at your own risk.
Copy the lines between the dashed lines into a file "cc.reg"
and double click on it.

- - - - - - cc.reg - - - -

REGEDIT4

[HKEY_CLASSES_ROOT\.cc]
@="cppfile"

[HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build System\Components\Platforms\Win32 (x86)\Tools\32-Bit C/C++-Compiler fr 80x86]
"Input_Spec"="*.c;*.cpp;*.cxx;*.cc"

[HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build System\Components\Tools\<Component 0x3>]
"Input_Spec"="*.c;*.cpp;*.cxx;*.cc"

- - - - - - - - - - - - - -

2.) Creating the project

- Create a new project "micolib" as a Win32 Static Library

- Add _WINDOWS, BUILD_MICO_DLL and __MICO_ORB__ to the
  precompiler definitions for Debug and Release

- Select "Multithreaded debugger" for Debug and "Multithreaded"
  for Release as Runtime Library

- Add the following files to the project:

  mico\orb\*.cc, mico\ir\ir_all.cc, mico\imr\imr_all.cc

- Remove the following files from the project:

  *.cc.diff
  win32def.cc,
  win32dll.cc
  os-unix.cc
  memcheck.cc
  memtrace.cc
  orb_all.cc

- Add mico\include\windows and mico\include to your include
  path. Move mico\include\windows up to the very top

- Add /Tp to the compiler paramters for the .cc files

- Compile the library

- Be prepared for a huge debug lib (up to 40M)

3.) Using the library

- Create a new project for your application and make it depend on
  the mico lib project.

- Add _WINDOWS to the precompiler definitions for Debug and Release

- Select "Multithreaded debugger" as Runtime Library for the
  debug build and "Multithreaded" for the release build

- Add wsock32.lib to the list of libraries and any other lib you
  want to link your application with. The mico lib will be linked
  to your application through the dependency

- Compile the project

- Be prepared for huge debug database files (.pdb)

---------------------------------------


When using micod with --forward it takes a rather long time (about
1.5 sec) to invoke an object after the server has been restarted
after a shutdown.

To improve the performance of rebinding to an object,
an adjustment can be made to the Microsoft TCP/IP implementation.
Without this change, the time it takes for a client to rebind to a
server object is significantly longer than needed.

Specifically, if a server responds that a port in the search range
is not in use, the Microsoft TCP/IP default is to continue trying
3 times with a half-second interval between each retry.
This value of 3 retries is settable in the registry, and
we recommend this be changed to 0.
Note that changing this parameter only takes effect after a reboot.

To set this manually, use REGEDIT:

Windows NT
------------------
create a DWORD value called TcpMaxConnectRetransmissions in:

HKEY_LOCAL_MACHINE\
SYSTEM\
CurrentControlSet\
Services\
Tcpip\
Parameters

and set the value to 0.

Windows 95
-----------------
create a DWORD value called MaxConnectRetries in:

KEY_LOCAL_MACHINE\
System\
CurrentControlSet\
Services\
VxD\
MSTCP

and set the value to 0.


HELP
----

Feel free to send comments, patches, or whatever over the mailing list!
