|
POST
|
In my experience I have found it much better to put event listeners on an extension. Windows forms and controls can have unexpected consequences in terms of threading and event handling. Performance should not be a major concern if you limit the processing in the event handler. If the event needs to trigger something on the dockable window control, I suggest you create your own custom events and set up the event listeners on the dockable control. Have an extension with event handlers for the toc events and raise your custom event in the extension events. Sounds a little convoluted but saves headaches in the long run. To recap, this has worked for me in the past: Dockable window: declare custom events and add handlers for them Extension: add handlers to TOC events, in handlers raise custom events.
... View more
09-01-2011
09:29 AM
|
0
|
0
|
897
|
|
POST
|
I need to access the workspace name. That is returning null too but not on my development machine and only when it is called from a form, if I call it from a command it works ok...
... View more
08-25-2011
04:37 AM
|
0
|
0
|
906
|
|
POST
|
I am getting similar behaviour on a 10.0 SP2 machine. 10.0 SP1 seem to work ok...
... View more
08-24-2011
11:25 AM
|
0
|
0
|
906
|
|
POST
|
MapControl has been somewhat of a bone of contention in my organization too. From what I have been told by ESRI at 9.3.1 the licensing agreement changed in regards to mapcontrol but it is only enforced from 10.0 onwards. Basically you need an Engine SDK license to do any sort of development with ESRI controls including the mapcontrol. That, even if the mapcontrol is deployed inside ArcMap as in a dockable window. This in my opinion is something that was taken away since ESRI had a map control as part of desktop going all the way to 8.1 or 8.0 (I can't remember which.) So the use of map controls far predates Engine and Engine licenses existence. So if you really need a mapcontrol in your development, you need an Engine SDK license on top of your ArcView license (we need it on top of our 23 ArcInfos, Spatial Analysts, ArcGIS Server, etc. and that not only for developers but also for automated nightly build servers and other virtual machines that compile and run automated tests.
... View more
08-24-2011
07:28 AM
|
0
|
0
|
451
|
|
POST
|
Strange... The MapDocument help says: "Remarks When opening or creating a map document with the IMapDocument Open() or New() methods, you should always make subsequent calls to IActiveView::Activate() in order to properly initialize the display of the PageLayout and Map objects. Call Activate() once for the PageLayout and once for each Map you will be working with. If your application has a user interface, you should call Activate() with the hWnd of the application's client area. If your application runs in the background and has no windows, you can always get a valid hWnd from the GDI GetDesktopWindow() function, part of the Win32 API." Have you tried the activate method call?
... View more
08-19-2011
12:02 PM
|
0
|
0
|
906
|
|
POST
|
If the link is broken, then the featureclass will always be null. If the purpose of the application is to display the layer connection properties and perhaps fix them, then you are on the right track. You can use the Idatalayer2.Connect method to fix the layers. Basically read the IName from the layer, display it, change it, make a new IName from the new properties and use the IName to reconnect using Idatalayer2.connect. The trick is the IName contains the info you see in the layer source tab of the properties. It is all the information you need to connect to data without actually making the connection (Open method does that.) That is available even when the layer is broken. The FeatureClass property however is a direct link to the data in the database, it is not metadata, it is the actual data, so if the connection is broken, it is null.
... View more
08-19-2011
06:49 AM
|
0
|
0
|
1617
|
|
POST
|
If you open the mxd in ArcMap, are the layers broken (red exclamation mark?) If not, are you running your code as different user than the one opening the mxds? Can you call open on the IDatalayer.datasourcename object?
... View more
08-19-2011
04:27 AM
|
0
|
0
|
1617
|
|
POST
|
You could call FinishSketch on the IeditSketch interface.
... View more
08-16-2011
12:20 PM
|
0
|
0
|
797
|
|
POST
|
The apply button is disabled when the properties have not changed. If you look at built in properties as soon as you change one, the properties are set to 'dirty' and it enables the apply button. I would suggest trying to implement the IPropertyPage.IsPageDirty property to return the appropriate return code when the values have changed.
... View more
08-15-2011
08:27 AM
|
0
|
0
|
526
|
|
POST
|
If you have a point or a table you will not get the length field. Length is needed as part of the geodatabase for line or polygon featureclasses, it's a mandatory field. Kind of like it needs an objectid and shape field (can have a different names.) Polygon has an area field too. Leaving these fields out would break the featureclasses.
... View more
08-08-2011
08:42 AM
|
0
|
0
|
332
|
|
POST
|
How long do the convert.toint32 functions taking? If they are significant (type conversions are one thing slower because of the .Net interop) you can probably do without it and compare the doubles.
... View more
07-28-2011
01:45 PM
|
0
|
0
|
1391
|
|
POST
|
I suggest adding an error handler (onError GoTo) and stepping through the code to see where it stops.
... View more
07-27-2011
10:15 AM
|
0
|
0
|
438
|
|
POST
|
The Geoprocessor GetMessage or GetMessages will return the messages, including any failure, error codes and hints for the failure reasons. When calling Geoprocessor, after it executes, success or failure, I like to output the messages to a log or a trace so I can diagnose the problems. It might help here. If you can post the messages it might be easier to help. Another thing I like to do when debugging Geoprocessing calls in ArcObjects, is to get some clean runs using ArcCatalog or ArcMap first. It eliminates a bunch of problems which are easier to debug in the interface.
... View more
07-20-2011
06:37 AM
|
0
|
0
|
948
|
|
POST
|
If I am not mistaken the original problem was with a map control, so probably engine. But be careful if you have any other references to the featureclass in your code too because they will be just as hosed. As for doing it in ArcMap, I wouldn't recommend it unless you have a compelling reason (I had to do it for a file workspace because ArcMap would cache the csv file schema and wouldn't refresh even if the layer was removed, updated (with new fields) and re-added.) I find ArcMap becomes somewhat unstable if it runs for more than a few days (some times a lot less) so I find shutdown as part of the workflow beneficial.
... View more
07-19-2011
12:24 PM
|
0
|
0
|
1151
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-02-2024 10:26 AM | |
| 1 | 07-05-2024 08:45 AM | |
| 1 | 10-05-2022 02:19 PM | |
| 6 | 03-27-2017 01:16 PM | |
| 1 | 05-05-2016 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-28-2025
07:37 AM
|