IActiveView.Output on a background thread

813
4
07-07-2011 12:18 AM
ItaiBar-Haim
New Contributor II
I want to output a part of the map's active view but without stopping the current UI thread.
I'm using C# and ArcGIS 9.3.1 (sp1).

I tried doing it in a background thread but this is the exception I get:

COMException was unhandled: "The data necessary to complete this operation is not yet available. (Exception from HRESULT: 0x8000000A)"

Is there a way of outputing a bitmap from the map in background?
0 Kudos
4 Replies
VictorAparicio
New Contributor
I have the same problem. When I try to export an image of the active view after a refresh, I have the COMException that says the data is not yet available.

Did you solve the problem??

Thanks a lot!
0 Kudos
ItaiBar-Haim
New Contributor II
Well, I didn't really solve it, as I still can't access it from multiple threads simultaneously. I made sure I only access it from one thread at a time (and generally - from one thread only, which is not the UI thread.)
0 Kudos
DubravkoAntonic
New Contributor III
Can't check right now but it looks to me that isn't possible to use reference from on thread into another. IActiveView is reference to the ActiveView object. I don't have idea how to reuse object from another thread but SDK has something in case you didn't know. It seems to me like good way to go.

http://resources.esri.com/help/9.3/arcgisengine/dotnet/2c2d2655-a208-4902-bf4d-b37a1de120de.htm#call...

Overhead in multi thread will slow whole thing and will make code more complex to maintain, are you sure this is the right way or maybe requirement is not suited for ArcMap Desktop rather some web service.
0 Kudos
VictorAparicio
New Contributor
I realized that my problem was caused because the map had not finished refreshing the annotation drawphase, so I solved it with a flag in the axMapControl OnAfterDraw
0 Kudos