WOK in windows.How to.

This is the procedure to get WOK working in Windows (personally I use Windows 2000 with Microsoft Visual Studio 6.0; but I hope it's the same fot other versions).

Event it isn't easy I try to be as clear as possible. However if you have some doubt, please ask me.

If you want, I can post you the DSW and DSP file or I can post the DLL files.

**************************************************************************** ****************************************************************************

First of all modify the following files in the src dir of OCAS 3.0:

1)FILE [src/WOKNT/WOKNT_ShellManager.cxx]. Comment the instruction:

//shells.Clear();

in WOKNT_ShellManager::KillAll() function.(It caused Memory deallocation error). It's not a definitive solution but works fine.

2)FILES=[ocas/src/WOKTclTools/WOKTclTools_Interpretor.cxx] and [ocas/src/WOKTCL/WOKTCL_DefaultCommand.cxx]

Comment the following lines:

//# pragma comment( lib, "tcl76i.lib" )

//# pragma message( "Information: tcl76i.lib is using as TCL library" )

you will link the TCL (8.2) LIB files directly with Visual Studio.

3)FILES= [ocas/src/WOKLibs/mscmd.cxx] and [ocas/src/WOKLibs/wokcmd.cxx]. Replace the line:

WOKTclTools_Package tcl(CurrentInterp, "Tcl", "7.6");

with the new one:

WOKTclTools_Package tcl(CurrentInterp, "Tcl", "8.2");

This avoid problems connected with TCL version.

**************************************************************************** ****************************************************************************

- Now you must create the "tkwok" project.

1)Create in Visual Studio a Win32 DLL (empty) project. Call it "tkwok".

2)Create ("New folder" command in Visual Studio) the following structure:

woktools

|---drv

woknt

|---drv

wokutils

|---drv

EDL

|---drv

ms

|---drv

wokapi

|---drv

wokbuilder

|---drv

wokdflt

|---drv

wokdeliv

|---drv

wokmake

|---drv

wokobjs

|---drv

wokorbix

|---drv

wokstep

|---drv

wokernel

|---drv

"drv" means derivated. Here you will put the "derivated" OCAS files (that are class generated from a "generic" class. See WOK docs for details.)

3)Add files ocas/src//*.cxx (for example Name=woktools) in the container. Repeat for each (woknt, wokutils ... etc).

4)Add files ocas/drv//*.cxx (for example Name=woktools) in the /drv container. Repeat for each (woknt, wokutils, ...etc).

5)Set the project environment ("Settings..." command):

INCLUDE_DIR+= ocas/src/, ocas/drv/, ocas/inc, /inc

DEFINES+= WNT,DEB,TKWOK_EXPORTS

LINK_LIBRARIES+= TKernel.lib, tcl82.lib

LINK_DIRS+= ocas/Windows_NT/lib, /lib

"+" means to add these settings to values that Visual Studio use by default. "WNT" set OCAS for Windows. "DEB" set OCAS for debugging output message.

6)Try to compile. At the end you should have created the output file in Debug dirs.

**************************************************************************** ****************************************************************************

- Now you must create "tkwoktcl" project in the same way.

1)Create in Visual Studio a Win32 DLL (empty) project. Call it "tkwoktcl".

2)Create ("New folder" command in Visual Studio) the following structure:

woktclutils

|----drv

woktcltools

|---drv

msapi

|---drv

woktcl

|---drv

3)Add files ocas/src//*.cxx (for example Name=woktclutils) in the container. Repeat for each .

4)Add files ocas/drv//*.cxx (for example Name=woktclutils) in the /drv container. Repeat for each .

5)Set the project environment:

INCLUDE_DIR+= ocas/src/, ocas/drv/, ocas/inc, /inc

DEFINES+= WNT,DEB,TKWOKTCL_EXPORTS

LINK_LIBRARIES+= TKernel.lib, tcl82.lib, tkwok.lib

LINK_DIRS+= ocas/Windows_NT/lib, /lib, /Debug

by "/Debug" I mean that you have to say Visual Studio where to find tkwok.lib.

6)Try to compile. At the end you should have created the output file in Debug dirs.

**************************************************************************** ****************************************************************************

- Create the project "CDLFront".

1)Create in Visual Studio a Win32 DLL (empty) project. Call it "CDLFront".

2)Add files ocas/src/CDLFront/*.cxx.

3)Add files ocas/drv/CDLFront/*.cxx.

4)Set the project environment:

INCLUDE_DIR+= ocas/src/, ocas/drv/CDLFRONT, ocas/inc, /inc

DEFINES+= WNT,DEB,CDLFRONT_EXPORTS

LINK_LIBRARIES+= TKernel.lib, tcl82.lib, tkwok.lib,tkwoktcl.lib

LINK_DIRS+= ocas/Windows_NT/lib, /lib, /Debug, /Debug

5)Try to compile. At the end you should have created the output file in Debug dirs.

6)Repeat the procedure for every following projects:

CPPClient (DEFINES+=CPPCLIENT_EXPORTS)

CPPExt (DEFINES+=CPPEXT_EXPORTS)

CPPIntExt (DEFINES+=CPPINTEXT_EXPORTS)

CPPJini (DEFINES+=CPPJINI_EXPORTS)

CSFDBSchema (DEFINES+=CSFDBSCHEMA_EXPORTS)

IDLFront (DEFINES+=IDLFRONT_EXPORTS)

TCPPExt (DEFINES+=TCPPEXT_EXPORTS)

**************************************************************************** ****************************************************************************

- Create the project mscmd.

1)Create in Visual Studio a Win32 DLL (empty) project. Call it "mscmd".

2)Add files ocas/src/WokLibs/mscmd.cxx.

3)Set the project environment:

INCLUDE_DIR+= ocas/src/WokLibs, ocas/drv/WokLibs, ocas/inc, /inc

DEFINES+= WNT,DEB,MSCMD_EXPORTS

LINK_LIBRARIES+= TKernel.lib, tcl82.lib, tkwok.lib,tkwoktcl.lib

LINK_DIRS+= ocas/Windows_NT/lib, /lib, /Debug, /Debug

4)Try to compile. At the end you should have created the output file in Debug dirs.

5)Repeat the procedure for every following projects:

wokcmd (file to add wokcmd.cxx DEFINES+=WOKCMD_EXPORTS)

wokdeliverysteps (file to add wokdeliverysteps.cxx DEFINES+=WOKDELIVERYSTEPS_EXPORTS)

wokdfltsteps (file to add wokdfltsteps.cxx DEFINES+=WOKDFLTSTEPS_EXPORTS)

wokobjssteps (file to add wokobjssteps.cxx DEFINES+=WOKOBJSSTEPS_EXPORTS)

wokorbixsteps (file to add wokorbixsteps.cxx DEFINES+=WOKROBIXSTEPS_EXPORTS)

woksteps (file to add woksteps.cxx DEFINES+=WOKSTEPS_EXPORTS)

woktoolscmd (file to add woktoolscmd.cxx DEFINES+=WOKTOOLSCMD_EXPORTS)

wokutilscmd (file to add wokutilscmd.cxx DEFINES+=WOKUTILSCMD_EXPORTS)

Now you have all bin files you need (OBJ PCH SBR IDB PDB DLL and LIB files!).

By now the procedure is simplier.

**************************************************************************** ****************************************************************************

Download then file AllWOK-3.0.tgz and extract it to a directory (for example wok-k4-5). Now you have this directory structure:

wok-k4-5

|-------lib

|----------

|-------Rtk-Release

**************************************************************************** ****************************************************************************

Remove every
dir. We won't use the OCAS bin (precompiled) files. By now means "/wok-k4-5/lib" (all absolute PATH on your hard disk). (please note to specify /lib !!!). For example:

set WOKHOME f:/ocas/wok-k4-5/lib

**************************************************************************** ****************************************************************************

Copy all bin files in dir (of the projects you have just created), in . We will use the libraries (DLL) just linked. For example:

cp <..>/tkwok/Debug/*.* $WOKHOME

cp <..>/tkwoktcl/Debug>/*.* $WOKHOME

[...] repeat for each project created.

**************************************************************************** ****************************************************************************

Create a WOKSESSION.EDL file in with the following istructions:

@ifnotdefined ( %WOKSESSION_EDL ) then

@set %WOKSESSION_EDL= "";

@set%WOKSESSION_ATListFile="/ATListFile";

@endif;

With this instruction we say WOK that "ATListFile" file contains factories. It doesn't exist but WOK will create it later.

**************************************************************************** ****************************************************************************

Delete (or comment) the following instruction from the Wok_Init.tcl file in :

;# rename exit tcl_exit_proc

;# rename wok_exit_proc exit

This is a problem probably connected with the Tcl 8.2 version (it seem's the "tcl_exit_proc" not to exist). I think that the memory will non be correctly deallocated but I suppose It's not a big problem.

**************************************************************************** ****************************************************************************

Create a file configure.tcl in with the following instruction:

set env(WOK_LIBRARY) [pwd]

set env(WOK_SESSIONID) [pwd]

set env(WOK_ROOTADMDIR) [pwd]

set env(WOK_LIBPATH) [pwd]

load woktoolscmd.dll Woktools

load wokutilscmd.dll Wokutils

load wokcmd.dll Wok

load mscmd.dll Ms

wokcd

This TCL file is more simple than "pkgindex.tcl" (see "wok-k4-5/lib/wnt/pkgindex.tcl") hat handle with package. In this mode you will load all WOK libraries at startup.

**************************************************************************** ****************************************************************************

Now start TCL shell (my version is 8.2 and it's ok).

**************************************************************************** ****************************************************************************

Change (command "cd") to dir. It's important. For example

cd f:/wok-k4-5/lib

**************************************************************************** ****************************************************************************

Type:

source configure.tcl

to load all the libraries and to set the WOK environment. Check no error message is displayed.

**************************************************************************** ****************************************************************************

Create a Factory/Warehouse/Workshop/Workbench/Package:

fcreate -DHome=[pwd] -DAdm=[pwd] -DStations=wnt -DDBMSystems=DFLT -DWarehouse=MyWarehouse MyFactory

wokcd MyFactory

Wcreate -DHome=[pwd] -DAdm=[pwd] -DStations=wnt -DDBMSystems=DFLT MyWarehouse

screate -DHome=[pwd] -DAdm=[pwd] -DStations=wnt -DDBMSystems=DFLT -DWorkbenchlist=MyWorkbenchlist -DParcelConfig= MyWorkshop

wokcd MyWorkshop

wcreate -DHome=[pwd]/MyWorkbench -DAdm=[pwd] -DSrc=[pwd]/MyWorkbench -DStations=wnt -DDBMSystems=DFLT -DDrv=[pwd]/MyWorkbench -DWOKVersion=2.0 -DDFLT=[pwd]/MyWorkbench -DDFLT_wnt=[pwd]/MyWorkbench MyWorkbench

wokcd MyWorkbench

ucreate -p MyPackage

wokcd MyPackage

**************************************************************************** ****************************************************************************

It'all. Now you can create your CDL file and try to process it (command "umake").

e-cocquebert's picture

I have a problem....

> 1)FILE [src/WOKNT/WOKNT_ShellManager.cxx].
> Comment the instruction:
> //shells.Clear();
> in WOKNT_ShellManager::KillAll()
> function.(It caused Memory deallocation
> error). It's not a definitive solution but
> works fine.

done

>
> 2)FILES=[ocas/src/WOKTclTools/WOKTclTools_Interpretor.cxx]
> and
> [ocas/src/WOKTCL/WOKTCL_DefaultCommand.cxx]
> Comment the following lines:
> //# pragma comment( lib,
> "tcl76i.lib" )
> //# pragma message( "Information:
> tcl76i.lib is using as TCL library" )
> you will link the TCL (8.2) LIB files
> directly with Visual Studio.

done

> 3)FILES= [ocas/src/WOKLibs/mscmd.cxx] and
> [ocas/src/WOKLibs/wokcmd.cxx]. Replace the
> line:
> WOKTclTools_Package tcl(CurrentInterp,
> "Tcl", "7.6");
> with the new one:
> WOKTclTools_Package tcl(CurrentInterp,
> "Tcl", "8.2");

i have not the WokLibs directory, so i have not the files wokcmd.cxx and mscmd.cxx, but i have wokcmd.dll, wokcmd.lib, mscmd.dll, mscmd.lib !! So i have the silly question : how did you do to have this folder ?!

Regards