In a previous post, we looked at how to use the VS 2008 .NET Upgrade Wizard to convert an ArcGIS VB6 project (AddShapeFile) to VB.NET. Now we’ll look at how to improve the code by using one of the ArcGIS .NET BaseClasses and the ArcGIS IDE Integration Tools.
One of the drawbacks of using the Upgrade Wizard is that it translates all of the raw COM classes and interfaces implemented in the VB6 project directly to VB.NET classes. That means that all interfaces such as ICommand are re-implemented exactly as they were in VB6. We can’t fault the wizard for doing so however, because it is doing its job, but as a developer, you really should really take advantage of the features the ArcGIS .NET SDK provides.
Furthermore, leaving the code as is has its drawbacks:
1. The code will be difficult to navigate and read for classes that have interfaces with many members.
2. Error handling becomes repetitive.
3. You will need to provide the plumbing for some members that we already provide the implementation for!
Therefore, in order to improve the original code we converted, let’s go back and simply create a new class that inherits from the ESRI.ArcGIS.ADF.BaseCommand and then move all of the remaining code over.
Here’s the steps:
1. Use the Upgrade Wizard to convert your VB 6 project to VB.NET (see Migrating from VB to .NET video).
2. Use the ArcGIS .NET IDE integration to create a new base class (BaseCommand in this case).
3. Copy and paste the code from the class the wizard created to the new base command class.
4. Use the underlying implementation of the base class where possible. E.g. BaseCommand::Bitmap.
5. Delete the old command.
Voila! Now the ICommand implementation uses the base class and the code is complete. Be sure to check out the video to see how it’s done.
Special thanks to Sirisha Karamchedu for contributing the video!
As you know, the ESRI Developer Summit is just around the corner. We worked hard to get all of the sessions and descriptions published early, so be sure to check out the online schedule to help plan your conference, and to get a sneak preview of what’s coming.
There are three main types of sessions:
- Presummit Seminars (3hr seminars, Monday, March 23)
- Plenary Session (3hrs, Tues morning, March 24)
- Technical Sessions (1:15hr sessions, Tues-Thurs, March 24-26)
Visit the ESRI Developer Summit for more event information.
The web page for submitting User Presentations is up.
The ESRI Developer Summit has always been a great productivity event, and we expect the 2009 DevSummit to be even better. ESRI staff have recently begun preparing about 25% more technical sessions. Attendees get to hear from and interact with the product teams and innovative developers who are creating our technologies and putting them to use. And over the past year, we have heard from you that we need to continue growing user-involvement. After all, it is a “Summit” for all of us, right?
So here we go. Share your ideas, present your work, or lead a topic of discussion with the developer community. If you have content that would be of interest to other attendees, then we encourage you to submit an abstract.
If you are interested in learning more about this opportunity visit the 2009 DevSummit “Share Your Work” webpage. That page also lists some suggested topic areas, but feel free to be creative.
Once accepted, your assigned conference planner will help get you what you need to be successful. And then your presentation will be scheduled and promoted on the website, conference materials, and signage.
At this point, it looks like we’re going to have about 10-15 scheduled slots. The capacity of the room will be between 50 and 70, so it should end up being a more interactive experience if you want it to be. This room will be part of the “Showcase” area, which is the central hub of the event. Then in the weeks leading up to the DevSummit, registered attendees will be able to vote so that particularly popular sessions can be moved into larger capacity rooms.
The deadline for submissions is February 6th, 2009. If you’re interested, let us know right away and we look forward to working with you.
Article submitted by the EDN Team at ESRI.
The Help System in the Eclipse Developer IDE is designed like the rest of the environment and is built with a plug-in architecture. Packaging the Java Help System as a Developer IDE Plug-in can significantly increase memory size requirements and cause the development environment to hang on install. This article discusses taking advantage of the Java Help System InfoCenter as a stand-alone Help System to be integrated into your Eclipse Developer Environment. This can be done in 3 easy steps.
Step 1: To get started, you must first ensure that you have installed the ArcGIS SDK Java Help System. This is a separate installer from ArcGIS Engine and/or ArcGIS Server for Java. Once successfully installed, the help system runs in single user mode as stand-alone help system for the Java developers. To set up the Java Help System in InfoCenter mode you simply execute the Java Help Server scripts located at ‘%ARCGISHOME%java docs’. To start the Help System in InfoCenter mode, execute the ‘startJavaHelpServer.bat’ file:
The default port the Java Help System InfoCenter will run on if you do not set the port when you execute the script will be ‘2112’. Clients can now access the Java Help System from any machine inside your network by pointing your web browser to the following url:
Step 2: Now that you have successfully started the Java Help System in InfoCenter mode, you can easily integrate the Help System into your Eclipse Developer IDE.
Make sure you have the latest supported Eclipse developer IDE, version 3.3.x, and open the Preferences dialog by selecting ‘Window->Preferences’ from the tools menu. In the Preference dialog, navigate to ‘Help->Content’ as shown in an illustration to the right.
Step 3: The Eclipse Help System needs to know the address (host/IP) and port of the remote server to integrate with the local system. Select the ‘Include help content form a remote infocenter‘ checkbox and provide the following server information:
- Host: Put a valid Server Name or IP Address where the remote infocenter is located. In our example the server name is ‘javabuild’.
- Path: ‘/help’.
- Select the ‘Use Port’ radio box and put ’2112′ in the port text box. The dialog should resemble the image below with your server name replacing ‘javabuild’.
Click ‘OK’ to close the Preference dialog and open up the Eclipse Help System, ‘Help->Help Contents’, to see the ArcGIS Java Developer Help System integrated into your local Eclipse Help System.
The Java Help System InfoCenter is a stand-alone server and doesn’t require an additional Web Server. However, in a production environment, you may want to control important issues that are best handled by a Web Server. For example, you may want to redirect requests by setting up a proxy module in Apache. This is all possible for more advanced users of the java Help System InfoCenter.
Well, you may not need us to state the obvious, but an overwhelming percentage of you chose Eclipse for your Java development (over 53%). Netbeans was a distant second with 25%. This could be because they’re both open source and free or it could be due to the fact that we’ve targeted these IDEs with our Engine and Server plug-ins? The popularity of Eclipse and Netbeans may not be surprising but anyone care to comment on why they use one instead of the other?
It was surprising to see JBuilder with such a low percentage (4%). Granted, we had a small sample population that took the survey, but maybe this is due to its price tag?
And lastly, in case you’re wondering, the single “Other answer …” was VI!
We’re happy to announce that ArcGIS Engine 9.3 as of Service Pack 1 is now officially supported on 32 bit RedHat Enterprise Linux 5! ArcGIS Engine has been supported on SUSE Enterprise Linux 10, Solaris 9, Solaris 10, RedHat Enterprise Linux 4, and of course Windows. Please feel free to check out the knowledge base article for steps on installing and upgrading ArcGIS Engine on this new platform.
As mentioned in a previous post, developing with VB6 with ArcGIS will no longer be supported at ArcGIS 9.4. The good news is that ArcGIS 9.x developers have a number of options when it comes time to migrating existing VB6 projects to .NET.
One of the easiest methods is to use the Visual Studio Upgrade/Conversion Wizard. Check out the video to see exactly how it works. As you’ll see, the wizard is easy to use, but as you can imagine, it does not upgrade everything perfectly. So before jumping in, be sure to review this document on MSDN, and here are a few other things to consider:
2. An Upgrade Report is created automatically so you can easily hunt down the items that didn’t automatically convert. Just look for “UPGRADE_ISSUE” comments in the code.
3. The .NET compiler will give you warnings and errors that were ignored in VB6 such as unused variable declarations and so on. This should help improve the quality of your code.
1. Not all ESRI.ArcGIS assemblies and types are mapped correctly and you need to deal with these issues manually. For example, the ESRI.ArcGIS.esriSystem.OLE_HANDLE.
2. The new project will likely reference VB.NET-specific compatibility assemblies (e.g. Microsoft.VisualBasic.dll) to map to the old VB6 types. This may or may not be desirable if you plan on moving the code to C# or if you want to just use the core .NET assemblies and types. Performance can be affected as well.
3. Some .NET controls don’t map 100% to their VB6 counterpart, and code changes are required. E.g. CommonDialog::xxx.
4. You may want to consider using Private or Public declares instead of Dim.
5. You need to set “Register for COM Interop” in the new project to register the classes as COM components.
6. It only converts to VB6 code to VB.NET, not C#.
The last thing to consider is that the wizard simply performs a raw conversion of the interfaces and classes as they are implemented in VB6. It has no way of knowing that there are a number of ArcGIS .NET base classes that can be used to accomplish the same task. Therefore, if you use the wizard, and if your VB6 code implements ICommand, ITool, IToolbar and IExtension, you should consider removing the class that is created, and re-implement it with the ArcGIS base classes. We’ll see this in a future How To… post.
Regardless of the cons here, it’s obvious that the Upgrade Wizard isn’t perfect but it does provide a fast and easy way to get you through the migration process.
Special thanks to Rob Burke for contributing the video that illustrates how to get this done!
Of the individuals that participated, it’s clear that Visual Studio 2005 with .NET 2.0 is the most popular IDE for ArcObjects development today. 50% of the community are developing with this configuration. The next most popular configuration is Visual Studio 2008 with .NET 3.5 at 32%.
A smaller percentage are taking advantage of the Visual Studio 2008 IDE improvements, but still building on top of the .NET 2.0 framework. This is surprising given that .NET 3.0 and 3.5 didn’t undergo any major architectural changes (still uses the .NET 2.0 CLR) and are considered an additive release. We would be interested in hearing more feedback about this!
There are limitations, but another interesting fact was that very few (2%) of the respondents identified that they were using Visual Studio Express. And of course, there are still a few (3%) implementing Visual Studio 6.0.
On that note, for all VB6 and VBA developers looking to transition to .NET, we are releasing a number blogs and videos on the migration process very soon. Keep your eyes posted.
In the mean time, let’s turn to the Java developers in the next poll and see what IDE they are using.
Thanks for the feedback!
Included are 10 questions on the following topics:
I know you are thinking “great, another ESRI survey”, but the data gathered here will help us make critical decisions about how we build and foster the online communities in the future.
And if you are reading this, then that means you are part of these communities, so now is your chance to help direct their (and your) future.
As always, your participation is valued and appreciated.
The Summer 2008 edition of ArcUser magazine includes an interesting article on Spatial Decision Support System (SDSS) developed for the GLOWA IMPETUS research program that provides an integrated approach to the efficient management of scarce water resources in West Africa. Using ArcGIS Engine Java, comprehensive ArcGIS functionalities and partly remote sensing analysis are incorporated in the SDSS. Specifically, the SDSS includes a GIS tool for visualization called the ArcGISDoubleMapPanel, which allows users to evaluate two multitemporal layers in one panel. This kind of functionality is not yet available in most GIS software and SDSSs.
The ArcGISDoubleMapPanel tool provides thematic and non-thematic raster and vector maps that can contain either two attributes and one time slider or one attribute and two time sliders (to compare two different time frames). Figures 1 and 2 contain screen shots of the ArcGISDoubleMapPanel tool during preliminary development of the SDSS. Two PageLayoutBeans, which have toolbars with common GIS tools and time sliders (for visualizing multitemporal time steps), are used. By displaying two feature layers with different attributes that are thematically mapped, the user can intuitively compare these attributes. A Java slider (JSlider) component, located below the two maps, allows the user to view changes in the scenario over time. This slider has access to multitemporal feature layers and provides different time increments. Using a processor that accesses the specific time step of the layer, the two maps of the ArcGISDoubleMapPanel are updated (using refresh) during run time. Based on the classification applied to the map, layers change color in response to movement of the time slider. In Figure 2, the ArcGISDoubleMapPanel displays feature data classified by one attribute. The user visually compares two maps from different time spans. This provides an easy way to detect change over time. Each PageLayoutBean has its own time slider.
Above: Screen shots showing the ArcGISDoubleMapPanel with two attributes (in this case two vector layers) and one time slider.
Above: Screen shots showing the ArcGISDoubleMapPanel displaying one attribute (population density) and two time sliders.
In addition to simultaneous visualization of multiple scenarios, the ArcGISDoubleMapPanel tool is also useful for performing change detection analyses, assessing current conditions and predicting future situations. To learn more about the SDSS, its architecture and implementation read the ArcUser article: Visualization, Interpretation and Evaluation.
Contributed by the ArcGIS Engine Java Product Team.