<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Bentley InRoads SDK [FAQ]</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Bentley InRoads SDK [FAQ]</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq</link><pubDate>Tue, 04 Aug 2015 13:57:25 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Kevin McDonald</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Current Revision posted to OpenRoads | OpenSite Wiki by Kevin McDonald on 8/4/2015 1:57:25 PM&lt;br /&gt;
&lt;p&gt;&lt;b&gt;&lt;img width="189" height="60" style="border-width:0px;" alt=" " src="/Other/Old_Site_Files/Bentley_Folders/m/support/17560/download.aspx" /&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE: This article applies to older versions of InRoads prior to the V8.5 versions.&amp;nbsp; More recent versions (V8.7-V8.11) deliver the SDK and help files with the product in the SDK directory.&lt;/strong&gt;&lt;/p&gt;
&lt;table align="left" style="border:0px solid #dce5f0;width:500px;background-color:#dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;span style="font-size:medium;"&gt;&lt;b&gt;Applies To&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bentley InRoads SDK&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;V8.5 and prior&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Original Author:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bentley Technical Support Group&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Digital Terrain Model Functions&lt;/li&gt;
&lt;li&gt;Coordinate Geometry Functions&lt;/li&gt;
&lt;li&gt;General Functions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also included are the SDK help , Visual Basic and Visual C++ examples.&lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000&lt;/li&gt;
&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin.&lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created.&lt;/p&gt;
&lt;p&gt;Items that get installed with InRoads SDK include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Header and library files (in the root directory)&lt;/li&gt;
&lt;li&gt;A help directory containing sdk.hlp&lt;/li&gt;
&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess.&lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Run the Visual Basic EXE file.&lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Below are the steps for debugging both the In-Process and Out-Of-Process applications:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL.
&lt;ul&gt;
&lt;li&gt;Compile to native code.&lt;/li&gt;
&lt;li&gt;Create symbolic debug info.&lt;/li&gt;
&lt;li&gt;No optimization.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open)
&lt;ul&gt;
&lt;li&gt;Go to process tab, right click ustation.exe, select debug.&lt;/li&gt;
&lt;li&gt;VC++ opens&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;VC++
&lt;ul&gt;
&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm.&lt;/li&gt;
&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL.&lt;/li&gt;
&lt;li&gt;Set breakpoints in the startform.frm.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;InRoads
&lt;ul&gt;
&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint.&lt;/li&gt;
&lt;li&gt;Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Determine what type of application you have then follow the instructions below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL).
&lt;ul&gt;
&lt;li&gt;Extension DLL using shared MFC DLL.&lt;/li&gt;
&lt;li&gt;Generate source file comments.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk.&lt;/li&gt;
&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib.
&lt;p&gt;Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Modify the Debug settings in order to debug VC++ application.
&lt;ul&gt;
&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog.&lt;/li&gt;
&lt;li&gt;Add a new configuration.&lt;/li&gt;
&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration.&lt;/li&gt;
&lt;li&gt;Copy the settings from the Release Configuration.&lt;/li&gt;
&lt;li&gt;Click OK and close the Build Configuration dialog.&lt;/li&gt;
&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe.&lt;/li&gt;
&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug).&lt;/li&gt;
&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7.&lt;/li&gt;
&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Option to add a new dialog box.
&lt;ul&gt;
&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App.&lt;/li&gt;
&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class.&lt;/li&gt;
&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp).&lt;/li&gt;
&lt;li&gt;Click Ok to dismiss the New Class dialog box.&lt;/li&gt;
&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard.&lt;/li&gt;
&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h.&lt;/li&gt;
&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;.&lt;/li&gt;
&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp.
&lt;ul&gt;
&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;//SDKsmpl *pDlg = NULL;&lt;br /&gt;int StartCommand ( )&lt;br /&gt;{&lt;br /&gt;HINSTANCE rscHndl;&lt;br /&gt;rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;SDKsmpl dlg;&lt;br /&gt;dlg.DoModal();&lt;br /&gt;// End of Modal&lt;br /&gt;// To create Non-Modal, uncomment the following lines&lt;br /&gt;//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;//if ( pDlg )&lt;br /&gt;// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;// End of Non-Modal code&lt;br /&gt;AfxSetResourceHandle ( rscHndl );&lt;br /&gt;return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS:
&lt;p&gt;EXPORTS&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;; Explicit exports can go here&lt;/li&gt;
&lt;li&gt;StartCommand&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All.&lt;/li&gt;
&lt;li&gt;Add something useful to this shell of an application.
&lt;ul&gt;
&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE).
&lt;ul&gt;
&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Whether compiling in Release or Debug mode:
&lt;ul&gt;
&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk).&lt;/li&gt;
&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib).&lt;/li&gt;
&lt;li&gt;Design dialog(optional).&lt;/li&gt;
&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;See the instructions below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the Visual C++ EXE file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;For debugging Visual C++ applications see below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL.&lt;/li&gt;
&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5).&lt;/li&gt;
&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma).&lt;/li&gt;
&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration).&lt;/li&gt;
&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/Products/w/Products__Wiki/product-technotes-and-faqs.aspx"&gt;Product TechNotes and FAQs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/Products/Road___Site_Design/w/Road_and_Site_Design__Wiki/inroads-product-technotes-faqs-and-support-video-clips.aspx"&gt;InRoads Product TechNotes FAQs And Support Video Clips&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;
&lt;p&gt;&lt;a title="KnowledgeBase" href="http://appsnet.bentley.com/kbase/"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="LEARN Server" href="http://lms.bentley.com"&gt;Bentley LEARN Server&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;Bentley&amp;#39;s Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="hr"&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: FAQs, Bentley InRoads SDK, Visual Basic, Visual C, Bentley InRoads&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK [FAQ]</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/10</link><pubDate>Fri, 21 Jun 2013 17:08:44 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisabeth Pry</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 10 posted to OpenRoads | OpenSite Wiki by Elisabeth Pry on 6/21/2013 5:08:44 PM&lt;br /&gt;
&lt;p&gt;&lt;b&gt;&lt;img style="border-width:0px;" alt="" src="/Other/Old_Site_Files/Bentley_Folders/m/support/17560/download.aspx" width="189" height="60" /&gt;&lt;/b&gt;&lt;/p&gt;
&lt;table style="border:0px solid #dce5f0;width:500px;background-color:#dce5f0;" border="0" align="left"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;span style="font-size:medium;"&gt;&lt;b&gt;Applies To&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bentley InRoads SDK&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;All&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Original Author:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bentley Technical Support Group&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Digital Terrain Model Functions&lt;/li&gt;
&lt;li&gt;Coordinate Geometry Functions&lt;/li&gt;
&lt;li&gt;General Functions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also included are the SDK help , Visual Basic and Visual C++ examples.&lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000&lt;/li&gt;
&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin.&lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created.&lt;/p&gt;
&lt;p&gt;Items that get installed with InRoads SDK include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Header and library files (in the root directory)&lt;/li&gt;
&lt;li&gt;A help directory containing sdk.hlp&lt;/li&gt;
&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess.&lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Run the Visual Basic EXE file.&lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Below are the steps for debugging both the In-Process and Out-Of-Process applications:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL.
&lt;ul&gt;
&lt;li&gt;Compile to native code.&lt;/li&gt;
&lt;li&gt;Create symbolic debug info.&lt;/li&gt;
&lt;li&gt;No optimization.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open)
&lt;ul&gt;
&lt;li&gt;Go to process tab, right click ustation.exe, select debug.&lt;/li&gt;
&lt;li&gt;VC++ opens&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;VC++
&lt;ul&gt;
&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm.&lt;/li&gt;
&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL.&lt;/li&gt;
&lt;li&gt;Set breakpoints in the startform.frm.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;InRoads
&lt;ul&gt;
&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint.&lt;/li&gt;
&lt;li&gt;Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Determine what type of application you have then follow the instructions below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL).
&lt;ul&gt;
&lt;li&gt;Extension DLL using shared MFC DLL.&lt;/li&gt;
&lt;li&gt;Generate source file comments.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk.&lt;/li&gt;
&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib.
&lt;p&gt;Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Modify the Debug settings in order to debug VC++ application.
&lt;ul&gt;
&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog.&lt;/li&gt;
&lt;li&gt;Add a new configuration.&lt;/li&gt;
&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration.&lt;/li&gt;
&lt;li&gt;Copy the settings from the Release Configuration.&lt;/li&gt;
&lt;li&gt;Click OK and close the Build Configuration dialog.&lt;/li&gt;
&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe.&lt;/li&gt;
&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug).&lt;/li&gt;
&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7.&lt;/li&gt;
&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Option to add a new dialog box.
&lt;ul&gt;
&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App.&lt;/li&gt;
&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class.&lt;/li&gt;
&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp).&lt;/li&gt;
&lt;li&gt;Click Ok to dismiss the New Class dialog box.&lt;/li&gt;
&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard.&lt;/li&gt;
&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h.&lt;/li&gt;
&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;.&lt;/li&gt;
&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp.
&lt;ul&gt;
&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;//SDKsmpl *pDlg = NULL;&lt;br /&gt;int StartCommand ( )&lt;br /&gt;{&lt;br /&gt;HINSTANCE rscHndl;&lt;br /&gt;rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;SDKsmpl dlg;&lt;br /&gt;dlg.DoModal();&lt;br /&gt;// End of Modal&lt;br /&gt;// To create Non-Modal, uncomment the following lines&lt;br /&gt;//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;//if ( pDlg )&lt;br /&gt;// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;// End of Non-Modal code&lt;br /&gt;AfxSetResourceHandle ( rscHndl );&lt;br /&gt;return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS:
&lt;p&gt;EXPORTS&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;; Explicit exports can go here&lt;/li&gt;
&lt;li&gt;StartCommand&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All.&lt;/li&gt;
&lt;li&gt;Add something useful to this shell of an application.
&lt;ul&gt;
&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE).
&lt;ul&gt;
&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Whether compiling in Release or Debug mode:
&lt;ul&gt;
&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk).&lt;/li&gt;
&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib).&lt;/li&gt;
&lt;li&gt;Design dialog(optional).&lt;/li&gt;
&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;See the instructions below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the Visual C++ EXE file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;For debugging Visual C++ applications see below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL.&lt;/li&gt;
&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5).&lt;/li&gt;
&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma).&lt;/li&gt;
&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration).&lt;/li&gt;
&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/Products/w/Products__Wiki/product-technotes-and-faqs.aspx"&gt;Product TechNotes and FAQs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/Products/Road___Site_Design/w/Road_and_Site_Design__Wiki/inroads-product-technotes-faqs-and-support-video-clips.aspx"&gt;InRoads Product TechNotes FAQs And Support Video Clips&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;
&lt;p&gt;&lt;a title="KnowledgeBase" href="http://appsnet.bentley.com/kbase/"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="LEARN Server" href="http://lms.bentley.com"&gt;Bentley LEARN Server&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;Bentley&amp;#39;s Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="hr"&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: FAQs, Bentley InRoads SDK, Visual Basic, Visual C, Bentley InRoads&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK [FAQ]</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/9</link><pubDate>Tue, 06 Nov 2012 20:42:02 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Jacquelyn Pettus</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 9 posted to OpenRoads | OpenSite Wiki by Jacquelyn Pettus on 11/6/2012 8:42:02 PM&lt;br /&gt;
&lt;p&gt;&lt;a href="http://selectservices.bentley.com/en-US"&gt;&lt;img border="0" src="/Other/Old_Site_Files/Bentley_Folders/m/support/17560/download.aspx" width="175" height="56" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Document Type:&lt;/strong&gt; FAQ&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Digital Terrain Model Functions&lt;/li&gt;
&lt;li&gt;Coordinate Geometry Functions&lt;/li&gt;
&lt;li&gt;General Functions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also included are the SDK help , Visual Basic and Visual C++ examples.&lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000&lt;/li&gt;
&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin.&lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created.&lt;/p&gt;
&lt;p&gt;Items that get installed with InRoads SDK include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Header and library files (in the root directory)&lt;/li&gt;
&lt;li&gt;A help directory containing sdk.hlp&lt;/li&gt;
&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess.&lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Run the Visual Basic EXE file.&lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Below are the steps for debugging both the In-Process and Out-Of-Process applications:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL.
&lt;ul&gt;
&lt;li&gt;Compile to native code.&lt;/li&gt;
&lt;li&gt;Create symbolic debug info.&lt;/li&gt;
&lt;li&gt;No optimization.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open)
&lt;ul&gt;
&lt;li&gt;Go to process tab, right click ustation.exe, select debug.&lt;/li&gt;
&lt;li&gt;VC++ opens&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;VC++
&lt;ul&gt;
&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm.&lt;/li&gt;
&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL.&lt;/li&gt;
&lt;li&gt;Set breakpoints in the startform.frm.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;InRoads
&lt;ul&gt;
&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint.&lt;/li&gt;
&lt;li&gt;Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Determine what type of application you have then follow the instructions below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL).
&lt;ul&gt;
&lt;li&gt;Extension DLL using shared MFC DLL.&lt;/li&gt;
&lt;li&gt;Generate source file comments.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk.&lt;/li&gt;
&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib.
&lt;p&gt;Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Modify the Debug settings in order to debug VC++ application.
&lt;ul&gt;
&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog.&lt;/li&gt;
&lt;li&gt;Add a new configuration.&lt;/li&gt;
&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration.&lt;/li&gt;
&lt;li&gt;Copy the settings from the Release Configuration.&lt;/li&gt;
&lt;li&gt;Click OK and close the Build Configuration dialog.&lt;/li&gt;
&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe.&lt;/li&gt;
&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug).&lt;/li&gt;
&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7.&lt;/li&gt;
&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Option to add a new dialog box.
&lt;ul&gt;
&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App.&lt;/li&gt;
&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class.&lt;/li&gt;
&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp).&lt;/li&gt;
&lt;li&gt;Click Ok to dismiss the New Class dialog box.&lt;/li&gt;
&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard.&lt;/li&gt;
&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h.&lt;/li&gt;
&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;.&lt;/li&gt;
&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp.
&lt;ul&gt;
&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;//SDKsmpl *pDlg = NULL;&lt;br /&gt;int StartCommand ( )&lt;br /&gt;{&lt;br /&gt;HINSTANCE rscHndl;&lt;br /&gt;rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;SDKsmpl dlg;&lt;br /&gt;dlg.DoModal();&lt;br /&gt;// End of Modal&lt;br /&gt;// To create Non-Modal, uncomment the following lines&lt;br /&gt;//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;//if ( pDlg )&lt;br /&gt;// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;// End of Non-Modal code&lt;br /&gt;AfxSetResourceHandle ( rscHndl );&lt;br /&gt;return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS:
&lt;p&gt;EXPORTS&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;; Explicit exports can go here&lt;/li&gt;
&lt;li&gt;StartCommand&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All.&lt;/li&gt;
&lt;li&gt;Add something useful to this shell of an application.
&lt;ul&gt;
&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE).
&lt;ul&gt;
&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Whether compiling in Release or Debug mode:
&lt;ul&gt;
&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk).&lt;/li&gt;
&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib).&lt;/li&gt;
&lt;li&gt;Design dialog(optional).&lt;/li&gt;
&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;See the instructions below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the Visual C++ EXE file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;For debugging Visual C++ applications see below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL.&lt;/li&gt;
&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5).&lt;/li&gt;
&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma).&lt;/li&gt;
&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration).&lt;/li&gt;
&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/Products/w/Products__Wiki/product-technotes-and-faqs.aspx"&gt;Product TechNotes and FAQs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/Products/Road___Site_Design/w/Road_and_Site_Design__Wiki/inroads-product-technotes-faqs-and-support-video-clips.aspx"&gt;InRoads Product TechNotes FAQs And Support Video Clips&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;
&lt;p&gt;&lt;a title="KnowledgeBase" href="http://appsnet.bentley.com/kbase/"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="LEARN Server" href="http://lms.bentley.com"&gt;Bentley LEARN Server&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;Bentley&amp;#39;s Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="hr"&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: Bentley InRoads, Bentley InRoads SDK, FAQs, Visual Basic, Visual C&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK [FAQ]</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/8</link><pubDate>Wed, 21 Jul 2010 19:46:24 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisa McGraw</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 8 posted to OpenRoads | OpenSite Wiki by Elisa McGraw on 7/21/2010 7:46:24 PM&lt;br /&gt;
&lt;p&gt;&lt;a href="http://selectservices.bentley.com/en-US"&gt;&lt;img height="56" width="175" src="/Other/Old_Site_Files/Bentley_Folders/m/support/17560/download.aspx" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Document Type:&lt;/strong&gt; FAQ &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also included are the SDK help , Visual Basic and Visual C++ examples. &lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. &lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. &lt;/p&gt;
&lt;p&gt;Items that get installed with InRoads SDK include: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. &lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Run the Visual Basic EXE file. &lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Below are the steps for debugging both the In-Process and Out-Of-Process applications: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
&lt;ul&gt;
&lt;li&gt;Compile to native code. &lt;/li&gt;
&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
&lt;li&gt;No optimization. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
&lt;ul&gt;
&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
&lt;li&gt;VC++ opens &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;VC++ 
&lt;ul&gt;
&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;InRoads 
&lt;ul&gt;
&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Determine what type of application you have then follow the instructions below. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
&lt;ul&gt;
&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
&lt;li&gt;Generate source file comments. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib.
&lt;p&gt;Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
&lt;ul&gt;
&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
&lt;li&gt;Add a new configuration. &lt;/li&gt;
&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Option to add a new dialog box. 
&lt;ul&gt;
&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
&lt;ul&gt;
&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;//SDKsmpl *pDlg = NULL;&lt;br /&gt;int StartCommand ( )&lt;br /&gt;{&lt;br /&gt;HINSTANCE rscHndl;&lt;br /&gt;rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;SDKsmpl dlg;&lt;br /&gt;dlg.DoModal();&lt;br /&gt;// End of Modal&lt;br /&gt;// To create Non-Modal, uncomment the following lines&lt;br /&gt;//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;//if ( pDlg )&lt;br /&gt;// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;// End of Non-Modal code&lt;br /&gt;AfxSetResourceHandle ( rscHndl );&lt;br /&gt;return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;} &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS:
&lt;p&gt;EXPORTS &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
&lt;li&gt;StartCommand &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
&lt;li&gt;Add something useful to this shell of an application. 
&lt;ul&gt;
&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
&lt;ul&gt;
&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Whether compiling in Release or Debug mode: 
&lt;ul&gt;
&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
&lt;li&gt;Design dialog(optional). &lt;/li&gt;
&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;See the instructions below: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;For debugging Visual C++ applications see below: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/Products/w/Products__Wiki/product-technotes-and-faqs.aspx"&gt;Product TechNotes and FAQs&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="/Products/Road___Site_Design/w/Road_and_Site_Design__Wiki/inroads-product-technotes-faqs-and-support-video-clips.aspx"&gt;InRoads Product TechNotes FAQs And Support Video Clips&lt;/a&gt; &lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;
&lt;p&gt;&lt;a href="http://appsnet.bentley.com/kbase/" title="KnowledgeBase"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lms.bentley.com" title="LEARN Server"&gt;Bentley LEARN Server&lt;/a&gt; &lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;Bentley&amp;#39;s Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU! &lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;div class="hr"&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: Bentley InRoads, Bentley InRoads SDK, FAQs, Visual Basic, Visual C&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK [FAQ]</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/7</link><pubDate>Tue, 22 Jun 2010 13:08:27 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisa McGraw</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 7 posted to OpenRoads | OpenSite Wiki by Elisa McGraw on 6/22/2010 1:08:27 PM&lt;br /&gt;
&lt;p&gt;&lt;a href="http://selectservices.bentley.com/en-US"&gt;&lt;img height="80" width="250" src="/Other/Old_Site_Files/Bentley_Folders/m/support/17560/download.aspx" border="0" alt="" /&gt;&lt;/a&gt; &lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Document Type:&lt;/strong&gt; FAQ &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also included are the SDK help , Visual Basic and Visual C++ examples. &lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. &lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. &lt;/p&gt;
&lt;p&gt;Items that get installed with InRoads SDK include: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. &lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Run the Visual Basic EXE file. &lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Below are the steps for debugging both the In-Process and Out-Of-Process applications: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
&lt;ul&gt;
&lt;li&gt;Compile to native code. &lt;/li&gt;
&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
&lt;li&gt;No optimization. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
&lt;ul&gt;
&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
&lt;li&gt;VC++ opens &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;VC++ 
&lt;ul&gt;
&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;InRoads 
&lt;ul&gt;
&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Determine what type of application you have then follow the instructions below. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
&lt;ul&gt;
&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
&lt;li&gt;Generate source file comments. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib.
&lt;p&gt;Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
&lt;ul&gt;
&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
&lt;li&gt;Add a new configuration. &lt;/li&gt;
&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Option to add a new dialog box. 
&lt;ul&gt;
&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
&lt;ul&gt;
&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;//SDKsmpl *pDlg = NULL;&lt;br /&gt;int StartCommand ( )&lt;br /&gt;{&lt;br /&gt;HINSTANCE rscHndl;&lt;br /&gt;rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;SDKsmpl dlg;&lt;br /&gt;dlg.DoModal();&lt;br /&gt;// End of Modal&lt;br /&gt;// To create Non-Modal, uncomment the following lines&lt;br /&gt;//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;//if ( pDlg )&lt;br /&gt;// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;// End of Non-Modal code&lt;br /&gt;AfxSetResourceHandle ( rscHndl );&lt;br /&gt;return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;} &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS:
&lt;p&gt;EXPORTS &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
&lt;li&gt;StartCommand &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
&lt;li&gt;Add something useful to this shell of an application. 
&lt;ul&gt;
&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
&lt;ul&gt;
&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Whether compiling in Release or Debug mode: 
&lt;ul&gt;
&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
&lt;li&gt;Design dialog(optional). &lt;/li&gt;
&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;See the instructions below: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;For debugging Visual C++ applications see below: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/Products/w/Products__Wiki/product-technotes-and-faqs.aspx"&gt;Product TechNotes and FAQs&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="/Products/Road___Site_Design/w/Road_and_Site_Design__Wiki/inroads-product-technotes-faqs-and-support-video-clips.aspx"&gt;InRoads Product TechNotes FAQs And Support Video Clips&lt;/a&gt; &lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;
&lt;p&gt;&lt;a href="http://appsnet.bentley.com/kbase/" title="KnowledgeBase"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lms.bentley.com" title="LEARN Server"&gt;Bentley LEARN Server&lt;/a&gt; &lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;Bentley&amp;#39;s Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU! &lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;div class="hr"&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: Bentley InRoads, Bentley InRoads SDK, FAQs, Visual Basic, Visual C&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK [FAQ]</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/6</link><pubDate>Tue, 22 Jun 2010 13:08:01 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisa McGraw</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 6 posted to OpenRoads | OpenSite Wiki by Elisa McGraw on 6/22/2010 1:08:01 PM&lt;br /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://selectservices.bentley.com/en-US/"&gt;&lt;/a&gt;&lt;a target="_blank" href="http://selectservices.bentley.com/en-US/"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;a href="http://selectservices.bentley.com/en-US" title="SELECT Services Online"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://selectservices.bentley.com/en-US"&gt;&lt;img height="80" width="250" src="/Other/Old_Site_Files/Bentley_Folders/m/support/17560/download.aspx" border="0" alt="" /&gt;&lt;/a&gt; &lt;a&gt;&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Document Type:&lt;/strong&gt; FAQ &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also included are the SDK help , Visual Basic and Visual C++ examples. &lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. &lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. &lt;/p&gt;
&lt;p&gt;Items that get installed with InRoads SDK include: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. &lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;Run the Visual Basic EXE file. &lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Below are the steps for debugging both the In-Process and Out-Of-Process applications: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
&lt;ul&gt;
&lt;li&gt;Compile to native code. &lt;/li&gt;
&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
&lt;li&gt;No optimization. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
&lt;ul&gt;
&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
&lt;li&gt;VC++ opens &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;VC++ 
&lt;ul&gt;
&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;InRoads 
&lt;ul&gt;
&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;Determine what type of application you have then follow the instructions below. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
&lt;ul&gt;
&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
&lt;li&gt;Generate source file comments. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib.
&lt;p&gt;Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
&lt;ul&gt;
&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
&lt;li&gt;Add a new configuration. &lt;/li&gt;
&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Option to add a new dialog box. 
&lt;ul&gt;
&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
&lt;ul&gt;
&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;//SDKsmpl *pDlg = NULL;&lt;br /&gt;int StartCommand ( )&lt;br /&gt;{&lt;br /&gt;HINSTANCE rscHndl;&lt;br /&gt;rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;SDKsmpl dlg;&lt;br /&gt;dlg.DoModal();&lt;br /&gt;// End of Modal&lt;br /&gt;// To create Non-Modal, uncomment the following lines&lt;br /&gt;//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;//if ( pDlg )&lt;br /&gt;// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;// End of Non-Modal code&lt;br /&gt;AfxSetResourceHandle ( rscHndl );&lt;br /&gt;return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;} &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS:
&lt;p&gt;EXPORTS &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
&lt;li&gt;StartCommand &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
&lt;li&gt;Add something useful to this shell of an application. 
&lt;ul&gt;
&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
&lt;ul&gt;
&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Whether compiling in Release or Debug mode: 
&lt;ul&gt;
&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
&lt;li&gt;Design dialog(optional). &lt;/li&gt;
&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;See the instructions below: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;For debugging Visual C++ applications see below: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/Products/w/Products__Wiki/product-technotes-and-faqs.aspx"&gt;Product TechNotes and FAQs&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="/Products/Road___Site_Design/w/Road_and_Site_Design__Wiki/inroads-product-technotes-faqs-and-support-video-clips.aspx"&gt;InRoads Product TechNotes FAQs And Support Video Clips&lt;/a&gt; &lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;
&lt;p&gt;&lt;a href="http://appsnet.bentley.com/kbase/" title="KnowledgeBase"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lms.bentley.com" title="LEARN Server"&gt;Bentley LEARN Server&lt;/a&gt; &lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;Bentley&amp;#39;s Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU! &lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;div class="hr"&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: Bentley InRoads, Bentley InRoads SDK, FAQs, Visual Basic, Visual C&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK FAQ</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/5</link><pubDate>Thu, 30 Oct 2008 14:32:33 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisa McGraw</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 5 posted to OpenRoads | OpenSite Wiki by Elisa McGraw on 10/30/2008 2:32:33 PM&lt;br /&gt;
&lt;a href="http://selectservices.bentley.com/en-US/" target="_blank"&gt;&lt;/a&gt;&lt;a href="http://selectservices.bentley.com/en-US/" target="_blank"&gt;
&lt;p&gt;
&lt;a href="http://selectservices.bentley.com/en-US" title="SELECT Services Online"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://selectservices.bentley.com/en-US"&gt;&lt;img src="http://communities.bentley.com/Other/Old_Site_Files/Bentley_Folders/m/support/17560/download.aspx" border="0" width="250" height="80" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;/a&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;strong&gt;Document Type:&lt;/strong&gt; FAQ 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
	&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
	&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Also included are the SDK help , Visual Basic and Visual C++ examples. 
&lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hardware&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Software&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
	&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. 
&lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. 
&lt;/p&gt;
&lt;p&gt;
Items that get installed with InRoads SDK include: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
	&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
	&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. 
&lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Run the Visual Basic EXE file. 
&lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Below are the steps for debugging both the In-Process and Out-Of-Process applications: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
	&lt;ul&gt;
		&lt;li&gt;Compile to native code. &lt;/li&gt;
		&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
		&lt;li&gt;No optimization. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
	&lt;ul&gt;
		&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
		&lt;li&gt;VC++ opens &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;VC++ 
	&lt;ul&gt;
		&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
		&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
		&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;InRoads 
	&lt;ul&gt;
		&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
		&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Determine what type of application you have then follow the instructions below. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
	&lt;ul&gt;
		&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
		&lt;li&gt;Generate source file comments. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
	&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib. 
	&lt;p&gt;
	Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. 
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
	&lt;ul&gt;
		&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
		&lt;li&gt;Add a new configuration. &lt;/li&gt;
		&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
		&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
		&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
		&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
		&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
		&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
		&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Option to add a new dialog box. 
	&lt;ul&gt;
		&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
		&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
		&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
		&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
		&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
		&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
		&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
		&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
	&lt;ul&gt;
		&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;
	//SDKsmpl *pDlg = NULL;&lt;br /&gt;
	int StartCommand ( )&lt;br /&gt;
	{&lt;br /&gt;
	HINSTANCE rscHndl;&lt;br /&gt;
	rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;
	AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;
	// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;
	SDKsmpl dlg;&lt;br /&gt;
	dlg.DoModal();&lt;br /&gt;
	// End of Modal&lt;br /&gt;
	// To create Non-Modal, uncomment the following lines&lt;br /&gt;
	//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;
	//if ( pDlg )&lt;br /&gt;
	// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;
	// End of Non-Modal code&lt;br /&gt;
	AfxSetResourceHandle ( rscHndl );&lt;br /&gt;
	return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;
	} 
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS: 
	&lt;p&gt;
	EXPORTS 
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
		&lt;li&gt;StartCommand &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
	&lt;li&gt;Add something useful to this shell of an application. 
	&lt;ul&gt;
		&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
	&lt;ul&gt;
		&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Whether compiling in Release or Debug mode: 
	&lt;ul&gt;
		&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
		&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
		&lt;li&gt;Design dialog(optional). &lt;/li&gt;
		&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
See the instructions below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
For debugging Visual C++ applications see below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
	&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
	&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
	&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
	&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;
&lt;a href="/Products/w/Products__Wiki/product-technotes-and-faqs.aspx"&gt;Product TechNotes and FAQs&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="/Products/Road___Site_Design/w/Road_and_Site_Design__Wiki/inroads-product-technotes-faqs-and-support-video-clips.aspx"&gt;InRoads Product TechNotes FAQs And Support Video Clips&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;&lt;a href="http://appsnet.bentley.com/kbase/" title="KnowledgeBase"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt; 
&lt;p&gt;
&lt;a href="http://lms.bentley.com" title="LEARN Server"&gt;Bentley LEARN Server&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU! 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class="hr"&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp; &amp;nbsp; 
&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: Bentley InRoads, Bentley InRoads SDK, FAQ, Visual Basic, Visual C&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK FAQ</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/4</link><pubDate>Tue, 21 Oct 2008 20:24:06 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisa McGraw</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 4 posted to OpenRoads | OpenSite Wiki by Elisa McGraw on 10/21/2008 8:24:06 PM&lt;br /&gt;
&lt;p&gt;
&lt;a href="http://selectservices.bentley.com/en-US/" target="_blank"&gt;&lt;img src="/photos/select_server_under_construction-gallery/images/10802/500x159.aspx" border="0" alt="Bentley Technical Support Group" title="Bentley Technical Support Group" width="250" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;strong&gt;Document Type:&lt;/strong&gt; FAQ 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
	&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
	&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Also included are the SDK help , Visual Basic and Visual C++ examples. 
&lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hardware&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Software&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
	&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. 
&lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. 
&lt;/p&gt;
&lt;p&gt;
Items that get installed with InRoads SDK include: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
	&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
	&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. 
&lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Run the Visual Basic EXE file. 
&lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Below are the steps for debugging both the In-Process and Out-Of-Process applications: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
	&lt;ul&gt;
		&lt;li&gt;Compile to native code. &lt;/li&gt;
		&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
		&lt;li&gt;No optimization. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
	&lt;ul&gt;
		&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
		&lt;li&gt;VC++ opens &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;VC++ 
	&lt;ul&gt;
		&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
		&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
		&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;InRoads 
	&lt;ul&gt;
		&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
		&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Determine what type of application you have then follow the instructions below. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
	&lt;ul&gt;
		&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
		&lt;li&gt;Generate source file comments. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
	&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib. 
	&lt;p&gt;
	Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. 
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
	&lt;ul&gt;
		&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
		&lt;li&gt;Add a new configuration. &lt;/li&gt;
		&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
		&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
		&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
		&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
		&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
		&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
		&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Option to add a new dialog box. 
	&lt;ul&gt;
		&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
		&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
		&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
		&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
		&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
		&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
		&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
		&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
	&lt;ul&gt;
		&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;
	//SDKsmpl *pDlg = NULL;&lt;br /&gt;
	int StartCommand ( )&lt;br /&gt;
	{&lt;br /&gt;
	HINSTANCE rscHndl;&lt;br /&gt;
	rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;
	AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;
	// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;
	SDKsmpl dlg;&lt;br /&gt;
	dlg.DoModal();&lt;br /&gt;
	// End of Modal&lt;br /&gt;
	// To create Non-Modal, uncomment the following lines&lt;br /&gt;
	//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;
	//if ( pDlg )&lt;br /&gt;
	// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;
	// End of Non-Modal code&lt;br /&gt;
	AfxSetResourceHandle ( rscHndl );&lt;br /&gt;
	return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;
	}
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS: 
	&lt;p&gt;
	EXPORTS 
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
		&lt;li&gt;StartCommand &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
	&lt;li&gt;Add something useful to this shell of an application. 
	&lt;ul&gt;
		&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
	&lt;ul&gt;
		&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Whether compiling in Release or Debug mode: 
	&lt;ul&gt;
		&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
		&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
		&lt;li&gt;Design dialog(optional). &lt;/li&gt;
		&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
See the instructions below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
For debugging Visual C++ applications see below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
	&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
	&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
	&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
	&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;
[[Product TechNotes and FAQs]] 
&lt;/p&gt;
&lt;p&gt;
[[InRoads Product TechNotes FAQs And Support Video Clips]]
&lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;&lt;a href="http://appsnet.bentley.com/kbase/" title="KnowledgeBase"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt; 
&lt;p&gt;
&lt;a href="http://lms.bentley.com" title="LEARN Server"&gt;Bentley LEARN Server&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU! 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class="hr"&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp; &amp;nbsp; 
&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: &lt;tags&gt;&lt;/tags&gt;&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK FAQ</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/3</link><pubDate>Tue, 21 Oct 2008 20:22:33 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisa McGraw</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 3 posted to OpenRoads | OpenSite Wiki by Elisa McGraw on 10/21/2008 8:22:33 PM&lt;br /&gt;
&lt;p&gt;
&lt;a href="http://selectservices.bentley.com/en-US/" target="_blank"&gt;&lt;img src="/photos/select_server_under_construction-gallery/images/10802/500x159.aspx" border="0" alt="Bentley Technical Support Group" title="Bentley Technical Support Group" width="250" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;strong&gt;Document Type:&lt;/strong&gt; FAQ 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
	&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
	&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Also included are the SDK help , Visual Basic and Visual C++ examples. 
&lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hardware&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Software&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
	&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. 
&lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. 
&lt;/p&gt;
&lt;p&gt;
Items that get installed with InRoads SDK include: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
	&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
	&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. 
&lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Run the Visual Basic EXE file. 
&lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Below are the steps for debugging both the In-Process and Out-Of-Process applications: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
	&lt;ul&gt;
		&lt;li&gt;Compile to native code. &lt;/li&gt;
		&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
		&lt;li&gt;No optimization. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
	&lt;ul&gt;
		&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
		&lt;li&gt;VC++ opens &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;VC++ 
	&lt;ul&gt;
		&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
		&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
		&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;InRoads 
	&lt;ul&gt;
		&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
		&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Determine what type of application you have then follow the instructions below. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
	&lt;ul&gt;
		&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
		&lt;li&gt;Generate source file comments. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
	&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib. 
	&lt;p&gt;
	Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. 
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
	&lt;ul&gt;
		&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
		&lt;li&gt;Add a new configuration. &lt;/li&gt;
		&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
		&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
		&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
		&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
		&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
		&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
		&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Option to add a new dialog box. 
	&lt;ul&gt;
		&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
		&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
		&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
		&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
		&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
		&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
		&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
		&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
	&lt;ul&gt;
		&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;
	//SDKsmpl *pDlg = NULL;&lt;br /&gt;
	int StartCommand ( )&lt;br /&gt;
	{&lt;br /&gt;
	HINSTANCE rscHndl;&lt;br /&gt;
	rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;
	AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;
	// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;
	SDKsmpl dlg;&lt;br /&gt;
	dlg.DoModal();&lt;br /&gt;
	// End of Modal&lt;br /&gt;
	// To create Non-Modal, uncomment the following lines&lt;br /&gt;
	//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;
	//if ( pDlg )&lt;br /&gt;
	// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;
	// End of Non-Modal code&lt;br /&gt;
	AfxSetResourceHandle ( rscHndl );&lt;br /&gt;
	return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;
	}
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS: 
	&lt;p&gt;
	EXPORTS 
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
		&lt;li&gt;StartCommand &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
	&lt;li&gt;Add something useful to this shell of an application. 
	&lt;ul&gt;
		&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
	&lt;ul&gt;
		&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Whether compiling in Release or Debug mode: 
	&lt;ul&gt;
		&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
		&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
		&lt;li&gt;Design dialog(optional). &lt;/li&gt;
		&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
See the instructions below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
For debugging Visual C++ applications see below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
	&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
	&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
	&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
	&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;
[[Product TechNotes and FAQs]] 
&lt;/p&gt;
&lt;p&gt;
[[GEOPAK TechNotes FAQs and Support Videos]]
&lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;&lt;a href="http://appsnet.bentley.com/kbase/" title="KnowledgeBase"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt; 
&lt;p&gt;
&lt;a href="http://lms.bentley.com" title="LEARN Server"&gt;Bentley LEARN Server&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU! 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class="hr"&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp; &amp;nbsp; 
&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: &lt;tags&gt;&lt;/tags&gt;&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK FAQ</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/2</link><pubDate>Tue, 21 Oct 2008 20:19:57 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Elisa McGraw</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 2 posted to OpenRoads | OpenSite Wiki by Elisa McGraw on 10/21/2008 8:19:57 PM&lt;br /&gt;
&lt;p&gt;
&lt;a href="http://selectservices.bentley.com/en-US/" target="_blank"&gt;&lt;img src="/photos/select_server_under_construction-gallery/images/10802/500x159.aspx" border="0" alt="Bentley Technical Support Group" title="Bentley Technical Support Group" width="250" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;Document Information&lt;/h1&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;strong&gt;Document Type:&lt;/strong&gt; TechNote &amp;nbsp; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Product(s):&lt;/strong&gt;&amp;nbsp; Bentley InRoads SDK 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Version(s):&lt;/strong&gt;&amp;nbsp; All
	&lt;/p&gt;
	&lt;p&gt;
	&lt;strong&gt;Original Author:&lt;/strong&gt; Bentley Technical Support Group
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;What is the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
	&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
	&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Also included are the SDK help , Visual Basic and Visual C++ examples. 
&lt;/p&gt;
&lt;h1&gt;What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hardware&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Software&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
	&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. 
&lt;/p&gt;
&lt;h1&gt;How do I use the Bentley InRoads SDK?&lt;/h1&gt;
&lt;p&gt;
To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. 
&lt;/p&gt;
&lt;p&gt;
Items that get installed with InRoads SDK include: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
	&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
	&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I compile Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. 
&lt;/p&gt;
&lt;h1&gt;How do I run Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Run the Visual Basic EXE file. 
&lt;/p&gt;
&lt;h1&gt;How do I debug Visual Basic applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Below are the steps for debugging both the In-Process and Out-Of-Process applications: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
	&lt;ul&gt;
		&lt;li&gt;Compile to native code. &lt;/li&gt;
		&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
		&lt;li&gt;No optimization. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
	&lt;ul&gt;
		&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
		&lt;li&gt;VC++ opens &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;VC++ 
	&lt;ul&gt;
		&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
		&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
		&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;InRoads 
	&lt;ul&gt;
		&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
		&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I compile Visual C++ applications for Bentley InRoads?&lt;/h1&gt;
&lt;p&gt;
Determine what type of application you have then follow the instructions below. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
	&lt;ul&gt;
		&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
		&lt;li&gt;Generate source file comments. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
	&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib. 
	&lt;p&gt;
	Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. 
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
	&lt;ul&gt;
		&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
		&lt;li&gt;Add a new configuration. &lt;/li&gt;
		&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
		&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
		&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
		&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
		&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
		&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
		&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Option to add a new dialog box. 
	&lt;ul&gt;
		&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
		&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
		&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
		&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
		&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
		&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
		&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
		&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
	&lt;ul&gt;
		&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;
	//SDKsmpl *pDlg = NULL;&lt;br /&gt;
	int StartCommand ( )&lt;br /&gt;
	{&lt;br /&gt;
	HINSTANCE rscHndl;&lt;br /&gt;
	rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;
	AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;
	// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;
	SDKsmpl dlg;&lt;br /&gt;
	dlg.DoModal();&lt;br /&gt;
	// End of Modal&lt;br /&gt;
	// To create Non-Modal, uncomment the following lines&lt;br /&gt;
	//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;
	//if ( pDlg )&lt;br /&gt;
	// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;
	// End of Non-Modal code&lt;br /&gt;
	AfxSetResourceHandle ( rscHndl );&lt;br /&gt;
	return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;
	}
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS: 
	&lt;p&gt;
	EXPORTS 
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
		&lt;li&gt;StartCommand &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
	&lt;li&gt;Add something useful to this shell of an application. 
	&lt;ul&gt;
		&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
	&lt;ul&gt;
		&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Whether compiling in Release or Debug mode: 
	&lt;ul&gt;
		&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
		&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
		&lt;li&gt;Design dialog(optional). &lt;/li&gt;
		&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;How do I run Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
See the instructions below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;How do I debug Visual C++ applications for InRoads?&lt;/h1&gt;
&lt;p&gt;
For debugging Visual C++ applications see below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
	&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
	&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
	&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
	&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;
[[Product TechNotes and FAQs]] 
&lt;/p&gt;
&lt;p&gt;
[[GEOPAK TechNotes FAQs and Support Videos]]
&lt;/p&gt;
&lt;h1&gt;External Links&lt;/h1&gt;&lt;a href="http://appsnet.bentley.com/kbase/" title="KnowledgeBase"&gt;Bentley Technical Support KnowledgeBase&lt;/a&gt; 
&lt;p&gt;
&lt;a href="http://lms.bentley.com" title="LEARN Server"&gt;Bentley LEARN Server&lt;/a&gt; 
&lt;/p&gt;
&lt;h1&gt;Comments or Corrections?&lt;/h1&gt;
&lt;p&gt;
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this &amp;quot;Comments or Corrections?&amp;quot; section. THANK YOU! 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class="hr"&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp; &amp;nbsp; 
&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: &lt;tags&gt;&lt;/tags&gt;&lt;/div&gt;
</description></item><item><title>Bentley InRoads SDK FAQ</title><link>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq/revision/1</link><pubDate>Mon, 30 Jun 2008 14:21:48 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e29d951d-e146-491e-9066-45ec94eca275</guid><dc:creator>Hannah Blye</dc:creator><comments>https://communities.bentley.com/products/road___site_design/w/road_and_site_design__wiki/2077/bentley-inroads-sdk-faq#comments</comments><description>Revision 1 posted to OpenRoads | OpenSite Wiki by Hannah Blye on 6/30/2008 2:21:48 PM&lt;br /&gt;
&lt;h6&gt;Q: What is the Bentley InRoads SDK?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; The Bentley InRoads SDK provides interfaces for Visual Basic, Visual C++, and MDL development tools that will allow you to create custom applications in the following areas: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Digital Terrain Model Functions &lt;/li&gt;
	&lt;li&gt;Coordinate Geometry Functions &lt;/li&gt;
	&lt;li&gt;General Functions &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Also included are the SDK help , Visual Basic and Visual C++ examples. 
&lt;/p&gt;
&lt;h6&gt;Q: What hardware/software do I need to run the Bentley InRoads SDK?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; InRoads SDK is available on request to members of the &lt;a href="http://www.bentley.com/developer/"&gt;Bentley Developer Network &lt;/a&gt;. You will need a version of Bentley InRoads SDK that is compatible with the version of your Bentley InRoads installation. Below are the hardware and software requirements for InRoads SDK: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hardware&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Pentium Class processor with sufficient memory to run Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Software&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Windows 98, Windows NT&amp;reg; 4.0, Windows 2000 &lt;/li&gt;
	&lt;li&gt;MicroSoft Visual Basic and/or MicroSoft Visual C++ &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;em&gt;Note:&lt;/em&gt; Be sure to add the location of the InRoads dlls to your PATH environment variable for example: c:\bentley\SelectCAD\bin. 
&lt;/p&gt;
&lt;h6&gt;Q: How do I use the Bentley InRoads SDK?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; To use InRoads SDK, run the Setup.exe and install to the InRoads(SelectCAD) directory. An SDK subdirectory will be created. 
&lt;/p&gt;
&lt;p&gt;
Items that get installed with InRoads SDK include: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Header and library files (in the root directory) &lt;/li&gt;
	&lt;li&gt;A help directory containing sdk.hlp &lt;/li&gt;
	&lt;li&gt;A samples directory containing Visual Basic and Visual C++ example applications &lt;/li&gt;
&lt;/ul&gt;
&lt;h6&gt;Q: How do I compile Visual Basic applications for Bentley InRoads?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; It depends on whether you are going to create an In-Process or Out-Of-Process application. Below is the process for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;ActiveX DLL&amp;quot;. Use the installed VBSamples InProcess example as a template. Copy the contents of the InProcess directory to a new directory and rename the project (vbp) file. Either modify the startForm.frm or delete it and create a new startForm.frm. A startForm.frm is required. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Compile with Project Type as &amp;quot;Standard EXE&amp;quot; . scadSDK_initialize() must be called before any other SDK functions. scadSDK_initialize verifies that there is a valid SelectCAD license, and it initializes the SDK functions. See the installed VBSamples OutOfProcess. 
&lt;/p&gt;
&lt;h6&gt;Q: How do I run Visual Basic applications for Bentley InRoads?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; Again, this depends on whether the application is In-Process or Out-Of-Process. Below are explanations for both: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; &lt;br /&gt;
From the InRoads Explorer, go to Tools &amp;gt; Run Macro, then select the Visual Basic DLL file. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; &lt;br /&gt;
Run the Visual Basic EXE file. 
&lt;/p&gt;
&lt;h6&gt;Q: How do I debug Visual Basic applications for Bentley InRoads?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; Below are the steps for debugging both the In-Process and Out-Of-Process applications: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Requires MicroSoft Visual C++) 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Set the Project Properties before compiling the Visual Basic DLL. 
	&lt;ul&gt;
		&lt;li&gt;Compile to native code. &lt;/li&gt;
		&lt;li&gt;Create symbolic debug info. &lt;/li&gt;
		&lt;li&gt;No optimization. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Windows Task Manager (MicroStation and InRoads have to be open) 
	&lt;ul&gt;
		&lt;li&gt;Go to process tab, right click ustation.exe, select debug. &lt;/li&gt;
		&lt;li&gt;VC++ opens &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;VC++ 
	&lt;ul&gt;
		&lt;li&gt;Go to File &amp;gt; Open &amp;gt; startform.frm. &lt;/li&gt;
		&lt;li&gt;Now go to Project Settings &amp;gt; Debug tab &amp;gt; additional dlls and select Visual Basic DLL. &lt;/li&gt;
		&lt;li&gt;Set breakpoints in the startform.frm. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;InRoads 
	&lt;ul&gt;
		&lt;li&gt;Go to Tools &amp;gt; Run Macro and select Visual Basic DLL. The focus will flip back to VC++ at the breakpoint. &lt;/li&gt;
		&lt;li&gt;Use VC++ debugging commands to step through code. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;All you need to do to debug an Out-Of-Process application is, use the Visual Basic debugger commands. &lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Q: How do I compile Visual C++ applications for Bentley InRoads?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; Determine what type of application you have then follow the instructions below. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; (Decide whether to create a modal or non-modal dialog box). 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard (DLL). 
	&lt;ul&gt;
		&lt;li&gt;Extension DLL using shared MFC DLL. &lt;/li&gt;
		&lt;li&gt;Generate source file comments. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;In order to have access to the InRoads SDK function signatures, set the Additional include directories under Project &amp;gt; Settings &amp;gt; C/C++ tab &amp;gt; Preprocessor Category to point to: the current location of the InRoads SDK for example; c:\Bentley\Selectcad\sdk. &lt;/li&gt;
	&lt;li&gt;In order to link, go to the Project Settings dialog and the Link tab and set Object/library modules to: the current location of SCadSDK.lib. For example, C:\Bentley\SelectCAD\sdk\SCadSDK.lib. 
	&lt;p&gt;
	Note: On the Link tab, you must select the following options: Generate debug info and Link incrementally. 
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Modify the Debug settings in order to debug VC++ application. 
	&lt;ul&gt;
		&lt;li&gt;Remove the Debug configuration in the Build &amp;gt; Configurations dialog. &lt;/li&gt;
		&lt;li&gt;Add a new configuration. &lt;/li&gt;
		&lt;li&gt;After selecting the Add... button, give a new name (for example, Debug) for the Configuration. &lt;/li&gt;
		&lt;li&gt;Copy the settings from the Release Configuration. &lt;/li&gt;
		&lt;li&gt;Click OK and close the Build Configuration dialog. &lt;/li&gt;
		&lt;li&gt;Under Project &amp;gt; Settings &amp;gt; Debug tab, set the Executable for the debug session. For example; c:\bentley\program\microstation\ustation.exe. &lt;/li&gt;
		&lt;li&gt;On the C/C++ tab of the Project Settings dialog, under the General Category, Optimizations must be set to Disable(Debug). &lt;/li&gt;
		&lt;li&gt;Debug info must be set to either Program Database for Edit and Continue, Program Database or C7. &lt;/li&gt;
		&lt;li&gt;The remainder of the options under the General Category are fine if you created the configuration as a copy of the Release mode. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Option to add a new dialog box. 
	&lt;ul&gt;
		&lt;li&gt;Go to VC++ &amp;gt; Insert &amp;gt; Resource &amp;gt; Dialog &amp;gt; Dialog Properties &amp;gt; General and set ID to DLG_SDK_SampleApp then Set Caption to Sample App. &lt;/li&gt;
		&lt;li&gt;Add a class for the dialog by going to View &amp;gt; Class Wizard. From the MFC ClassWizard dialog, select the Add Class. &lt;/li&gt;
		&lt;li&gt;For the Class Information, set Name to something you choose for example; SDK_dlg, Pick the Base class(i.e. CDialog), Pick the Dialog ID(i.e. DLG_SDK_SampleApp). &lt;/li&gt;
		&lt;li&gt;Click Ok to dismiss the New Class dialog box. &lt;/li&gt;
		&lt;li&gt;Click Ok to Create the class and dismiss the MFC ClassWizard. &lt;/li&gt;
		&lt;li&gt;ClassWizard should have created two more files: SDK_dlg.cpp and SDK_dlg.h. &lt;/li&gt;
		&lt;li&gt;Add the following include file to the main project file, sample.cpp: &amp;quot;SDK_dlg.h&amp;quot;. &lt;/li&gt;
		&lt;li&gt;Add the following include files to SDK_dlg.cpp: &amp;quot;SCadCogo.h&amp;quot; and &amp;quot;SCadDTM.h&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;StartCommand function is required in the primary project cpp file for example, sample.cpp. 
	&lt;ul&gt;
		&lt;li&gt;Add the following function just after your application object is declared probably at the end of the file: &lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	// Uncomment the following line to create a non-modal dialog box&lt;br /&gt;
	//SDKsmpl *pDlg = NULL;&lt;br /&gt;
	int StartCommand ( )&lt;br /&gt;
	{&lt;br /&gt;
	HINSTANCE rscHndl;&lt;br /&gt;
	rscHndl = AfxGetResourceHandle ( );&lt;br /&gt;
	AfxSetResourceHandle ( GetModuleHandle ( &amp;quot;VCDtmTest.dll&amp;quot;));&lt;br /&gt;
	// Modal only remove these lines if you plan on creating a non-modal dialog&lt;br /&gt;
	SDKsmpl dlg;&lt;br /&gt;
	dlg.DoModal();&lt;br /&gt;
	// End of Modal&lt;br /&gt;
	// To create Non-Modal, uncomment the following lines&lt;br /&gt;
	//pDlg-&amp;gt;Create ( IDD_DIALOG1, NULL);&lt;br /&gt;
	//if ( pDlg )&lt;br /&gt;
	// pDlg-&amp;gt;ShowWindow(SW_SHOW);&lt;br /&gt;
	// End of Non-Modal code&lt;br /&gt;
	AfxSetResourceHandle ( rscHndl );&lt;br /&gt;
	return ( 0 ); // This should be 1 if you are running a non-modal application&lt;br /&gt;
	}
	&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;Add the StartCommand function to the DEF file after EXPORTS: 
	&lt;p&gt;
	EXPORTS 
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;; Explicit exports can go here &lt;/li&gt;
		&lt;li&gt;StartCommand &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Now is a good time to Save all the files in the project and Rebuild All. &lt;/li&gt;
	&lt;li&gt;Add something useful to this shell of an application. 
	&lt;ul&gt;
		&lt;li&gt;At this point, the &amp;quot;do something&amp;quot; part of the application is designed. There are VC++ examples installed with InRoads SDK that will serve as a point of reference for creating a simple dialog and using InRoads SDK functions. See the installed VCSamples. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a new project in VC++ using the MFC AppWizard(EXE). 
	&lt;ul&gt;
		&lt;li&gt;Select all Default settings except, choose &amp;quot;Dialog based application&amp;quot; and toggle off &amp;quot;Active X Controls&amp;quot;. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Whether compiling in Release or Debug mode: 
	&lt;ul&gt;
		&lt;li&gt;Set the Additional include directories under Project&amp;gt;Settings&amp;gt;C/C++ tab&amp;gt;Preprocessor Category to point to the current location of the InRoads SDK ( i.e. c:\bentley\Selectcad\sdk). &lt;/li&gt;
		&lt;li&gt;In the Project&amp;gt;Settings&amp;gt;Link tab, set Object/library modules to the current location of the SCadSDK.lib (i.e. c:\bentley\SelectCAD\sdk\SCadSDK.lib). &lt;/li&gt;
		&lt;li&gt;Design dialog(optional). &lt;/li&gt;
		&lt;li&gt;Make sure to call scadSDK_initialize before calling any other SDK functions. Also include the necessary SCadXXX.h files for the InRoads SDK functions. &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Q: How do I run Visual C++ applications for InRoads?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; See the instructions below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;From the InRoads Explorer go to Tools &amp;gt; Run Macro, then select the Visual C++ DLL file(Release configuration). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Run the Visual C++ EXE file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h6&gt;Q: How do I debug Visual C++ applications for InRoads?&lt;/h6&gt;
&lt;p&gt;
&lt;strong&gt;A:&lt;/strong&gt; For debugging Visual C++ applications see below: 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Follow the steps listed in &lt;a href="http://selectservices.bentley.com/SelectWebSite/templates/TechnoteIndividual.aspx?NRMODE=Published&amp;amp;NRNODEGUID=%7bE95E9CA9-E865-4C41-94BB-C98299BE4A7B%7d&amp;amp;NRORIGINALURL=%2fen-US%2fSupport%2fSupport%2bTools%2fTechNotes%2band%2bFAQs%2fBentley%2bInRoads%2fBentley%2bInRoads%2bSDK%2ehtm&amp;amp;NRCACHEHINT=Guest#7"&gt;question 7&lt;/a&gt; for creating the Debug build of the DLL. &lt;/li&gt;
	&lt;li&gt;In Visual C++ start debugging application by setting a breakpoint first, then Start Debug(F5). &lt;/li&gt;
	&lt;li&gt;MicroStation will open, load InRoads(i.e. mdl load C:\Bentley\SelectCAD\bin\ CivUstZR.ma). &lt;/li&gt;
	&lt;li&gt;From the InRoads Explorer, Tools-&amp;gt;Run Macro, then select the Visual C++ DLL file(Debug configuration). &lt;/li&gt;
	&lt;li&gt;The screen will flip back to VC++ at the breakpoint, use the VC++ debugger commands to step through the code. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Out-Of-Process&lt;/strong&gt; 
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Compile the VC++ EXE in the Debug configuration. Use VC++ debugging commands to step through code.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: &lt;tags&gt;&lt;/tags&gt;&lt;/div&gt;
</description></item></channel></rss>