配置VC6的开发环境需要下面三步:
a.增加用omniidl生成的idl文件到工程中(Insert->"Files into Project")
b.设置include library文件
1.VC6的Tools-->Options下,选择Directories,在Show directories for"中选择Include files,增加omniORB 的安装
目录到列表框中(this is <Top-Level Directory>/include).
2.在"Show directories for"中, 选择 "Library files".增加omniORB 的库文件到列表框中(this is <Top-Level Directory/lib/x86_win32).
c.设置macros and libraries
1. 在Build->Settings下, 选择"C/C++" tab.
2. 在 "Category" box下, 选择 "C++ Language". 选中
"Enable exception handling" box.
3. 在 "Category" 中, 选择 "Code Generation". 在 "Use run-time library" box, 选择 "Multithreaded DLL".
4. **This is an important step.**
In the "Category" box, select "Preprocessor". In the
"Preprocessor" box, add the macros
__WIN32__,__x86__,_WIN32_WINNT=0x0400
If this is NT 4.0, Windows 2000 or XP (or something later), add
the macros __NT__ and __OSVERSION__=4 as well.
5. Select the "Link" tab.
6. In the "Category" box, select "Input". In the "Object/library
modules" box, add the following libraries: ws2_32.lib,
mswsock.lib, advapi32.lib, omniORB400_rt.lib,
omniDynamic400_rt.lib, omnithread30_rt.lib
If you are building a debug executable, the debug version of the
libraries: omniORB400_rtd.lib, omniDynamic400_rtd.lib and
omnithread30_rtd.lib should be used.
d) Your project is now set up, and you can build it.
If you want to use the static versions of omniORB and omnithread, you
must add the macro _WINSTATIC (see step (c) 4, above), and replace the
libraries omniORB400_rt.lib, omniDynamic400_rt.lib and
omnithread30_rt.lib with omniORB4.lib, omniDynamic4.lib and
omnithread.lib (see step (c) 6, above).