You are on page 1of 37

2014

Visual
Studio Setup

Visual Studio Set up Documentvin Jaipuriyar


Visual Studio Setup

1Purpose:
Purpose of this document is to define the process to setup build and debug custom DLL using VisualStudio.

2Assumption:
It is assumed that correct version of Microsoft Visual studio is installed. Microsoft Visual Studio is installed
tosupport 64 bit code generation.

3 Steps:
3.1 Create Properties file
Copy and paste following information is Text Editor. Make sure there no “line breaks” in the contents
forfollowing TAGS:

x AdditionalIncludeDirectories
x PreprocessorDefinitions
x AdditionalDependencies
x DelayLoadDLLs

<?xml version="1.0" encoding="utf-8"?>


<Project DefaultTargets="Build" ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<_PropertySheetDisplayName>CHANGE_ME</_PropertySheetDisplayName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>TC_ROOT\include;TC_ROOT\include_cpp;<Include custom header
folder></AdditionalIncludeDirectories>

<PreprocessorDefinitions>STEP;AP203;AP214;WIN32_LEAN_AND_MEAN;WNT;_CRT_SECURE_NO_DEPREC
ATE;_CRT_NONSTDC_NO_DEPRECATE;_SECURE_SCL=0;_HAS_TR1=0;_WIN32;WIN32;_WIN64;_INTEL=1;CR
TAPI1=_cdecl;CRTAPI2=cdecl;IMAN_TAO;BYPASS_FLEX;POMDLL;IPLIB=none;%(PreprocessorDefinitions)</P
reprocessorDefinitions>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalOptions>
</AdditionalOptions>
<Optimization>Full</Optimization>
<OmitFramePointers>true</OmitFramePointers>
Visual Studio Setup

<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<AdditionalOptions>/ignore:4099 /ignore:4199 %(AdditionalOptions)</AdditionalOptions>

<AdditionalDependencies>libsyss.lib;libpom.lib;libtcsso.lib;libae.lib;libappr.lib;libarchive.lib;libbackup.lib;lib
bom.lib;libcfm.lib;libconstants.lib;libcxpom.lib;libdmi.lib;libecm.lib;libeint.lib;libepm.lib;libfclasses.lib;libfor
m.lib;libgms.lib;libgrm.lib;libtcinit.lib;libtc.lib;libtccore.lib;libtctrushape.lib;libinternal_exits.lib;libvalidation.
lib;libitk.lib;liblov.lib;libme.lib;libmgc.lib;libobjio.lib;libpie.lib;libai.lib;libproperty.lib;libps.lib;libpublication.li
b;libqry.lib;libclips.lib;libclipsutil.lib;librbf.lib;libce.lib;libres.lib;libsa.lib;libss.lib;libstep.lib;libsub_mgr.lib;libt
extsrv.lib;libtie.lib;libnxmgr_im.lib;libaie.lib;libics.lib;libeintstub.lib;libsml.lib;libuser_exits.lib;librdv.lib;libcol
labctx.lib;libmechatronics.lib;libtccoreext.lib;libusagewc.lib;libusage.lib;libcontmgmt.lib;libtc_utils.lib;libsch
mgt.lib;libschmgt_bridge.lib;libdocmgt.lib;libdocmgtapp.lib;libvm.lib;libadsfoundationdispatch.lib;libcm.lib;
libcmdispatch.lib;libbase_utils.lib;libmld.lib;libfunctionality.lib;libmfg.lib;libmfgbvr.lib;libtcserverutil.lib;libc
ondvalidation.lib;libbooleanmath.lib;libconfigurator.lib;libfnd0booleansolve.lib;libsecore.lib;libFnd0formula
mgmt.lib;%(AdditionalDependencies)</AdditionalDependencies>

<AdditionalLibraryDirectories>TC_ROOT\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

<DelayLoadDLLs>libtcsso.dll;libict.dll;libae.dll;libappr.dll;libarchive.dll;libbackup.dll;libbom.dll;libcfm.dll;libd
mi.dll;libecm.dll;libeint.dll;libepm.dll;libform.dll;libgrm.dll;libtccore.dll;libtctrushape.dll;libinternal_exits.dll;
libitk.dll;libvalidation.dll;liblov.dll;libme.dll;libmechatronics.dll;libmgc.dll;libobjio.dll;libproperty.dll;libps.dll;
libpublication.dll;libqry.dll;libres.dll;libstep.dll;libsub_mgr.dll;libtccoreext.dll;libnxmgr_im.dll;libpie.dll;libai.
dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
<PreventDllBinding>false</PreventDllBinding>
<ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile>
</Link>
</ItemDefinitionGroup>
</Project>

x Change the highlighted variables (TC_ROOT) as per the installed environment.


x Change the highlighted CHANGE_ME to the desired project name.
x Save it as <project_name>.props file

3.2Create Batch Command File


1.Create .bat file with following content

@echo off

set TC_ROOT=<Specify full path as per your installation>


set TC_DATA=< Specify full path as per your installation>
call %TC_DATA%\tc_profilevars.bat
Visual Studio Setup

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"ÅChange this as


per your Visual Studio installed on your system.

2.Save file in folder of your choice.

3.3Create Preference
OOTB TC 10.1 does not defined TC_customization_libraries preference. For custom libraries to be
recognized by tcserver, it is required to have the preference and include the library name (without .dll)in
this preference.

The library name should be same as that is specified in CUSTOM_register_exit API.

To create preferences follow these steps:

1. Start Teamcenter
2. In Teamcenter got Edit->Options menu. Following dialog will be displayed

3.Click on Filters
Visual Studio Setup

4. In the search field enter “TC_cust”.


5. If the preference exists then it will be displayed.
Visual Studio Setup

a.Select the displayed preference and click “Edit”.


Visual Studio Setup

b.Enter library name in text field and click on “+”


c.The specified library will be added to the list
d.Click “Save” to save the preference
6.If preference does not exists
a.Click on create ICON to display create widow
b. Enter “TC_customization_libraries” in “Name” field
c. Select “Site” in “Protection Scope” dropdown field
d. Select “General” in “Category” dropdown field
e. Select “Multiple” in “Multiple” dropdown field
f.Enter library name in text field and click “+”
g.The specified name will be added to the values field
h.Enter some text in “Description” field for “Save” button to be enabled
i.Click on “Save” to save the preference.
3.4Start Visual Studio

1.Double click on .bat file to launch Visual Studio


2.Create empty project

3.Select “Empty Project”


4. Specify project name in “Name” field
5. Select suitable location for project using “Browse” button

6. Click “Ok”
7. New project is created
8. Select “Configuration Manager” from drop down for “Win32” list

9.Configuration Manager dialog is displayed


10.Select “<New..>” in Platform drop down

11. Select “x64” for “Platform” and “<Empty>” for “Copy setting from:”. If not available
forselection then enter “x64”.
12. Click “OK”
13. Close “Configuration Manager” window
14. New configurations “Debug | x64” and “Release | x64” will be created as shown
15.

Remove “Debug | Win32” and “Release | Win32” using RMB->Remove menu


16.Copy the saved properties file into the project folder

17.Add your custom properties using RMB->Add Existing Property Sheet

18.Select properties file

19. Click “Open”


20. Property is added under “Debug | x64”
Visual Studio Setup

21. Repeat steps 19-21 for “Release | x64”


22. Open properties file using RMB->Properties menu

23.Properties dialog is displayed


24. Select “General” and change value for “Target Extension” from .exe to .dll by using <Edit..>in
the drop down
25.Change .exe to .dll

26. Click “OK”


27. Check to make sure that “Multi-Threaded DLL (/MD) is selected for “Runtime Library”
underC/C++->Code Generation section
28. Check to make sure “Yes (/DEBUG)” is selected for “Generate Debug Info” under Linker-
>Debugging section.
29. Click “OK”
30. Select project name node in properties tab and perform RMB->Properties
31. Make sure “Configuration Type” is set “Dynamic Link Library (.dll)” under “Configuration
Properties->General” section.
32.Include existing Header and source file in “solution” tab
Visual Studio Setup

33.

Select Header and perform RMB->Add->Existing Item

34. Navigate to the folder where header file resides and select all required header files and
click“Add”
Visual Studio Setup

35. Preform same action for Source Files


36. Header and Source Files are added to solution

37.Update the header file folder in properties tab


38. Select “libCUSTOM” and perform RMB->Properties

39. Updated “Additional Include Directories” under C/C++->General section


40. Click on the drop down on the values column and select “<Edit..>”
41. Additional Include Directories dialog is displayed

42. If a directory for the custom header file was added in .props file and it does not exists.
Thenremove that folder by selecting the line and clicking on “X”.
43. Now click on “Folder” ICON to add desired header file folder
44. This will display a “…” (three dot browse) button to browse for folder.
45.Click on “…” button and browse to folder where header files resides and click “Select Folder”

46.Selected folder is added to the list


47. Repeat steps 43-45 if more folders needs to be added.
48. Click “OK”
49. Click “OK” to close properties dialog
50. Build project using Build->Build libCUSTOM menu

51.Upon success full build following message will be displayed.


52.Generated files will be found in <Project Folder>\x64\Debug folder

53.Copy .dll, .exp, .ilk, .pdb files to %TC_ROOT%\bin folder


54.If the Teamcenter deployment is set for 4-Tier then, change the pool manager configuration
to start only one tcserver.
55.It is best to have a 2-Tier deployment to debug the code.
56.Start server manager if 4-Tier else start RAC.
57.In MSDEV select Debug->Attach Process
58.Select “tcserver” and click “Attach”

59. Set break points in your code


60. And invoke actions that will execute the code where break point I set.
61. The execution will stop as soon as break point is encountered.
62. Step through the code as desired.

You might also like