troubleshooting Question

Check if ArgGIS running - events

Avatar of theinterface
theinterface asked on
Delphi
9 Comments1 Solution285 ViewsLast Modified:
Hi Experts

I have a problem: My application, which I write in Delphi 7, uses ArcMap, exactly esriArcmap 9.1 to read from a mxd datafile. I do it like that :

pMxDocForList:=CoMxDocument.Create as IMxDocument;
pAppForList:=(pMxDocForList as IDocument).Parent;
pAppForList.OpenDocument( aMapDoc );

Then, when I immidiately afterwards try to read from pAppForList.Document, I get "Memory Acces Error", because ArcMap needs time to start itself. So, if I insert after the mentioned lines the instruction Delay(5000) which waits 5s and gives this way ArcMap enough time for start, all will work without problems. But that is not a good solution. Besides I'm getting problems on slower Systems, where this instruction schould wait more.

Someone has me advised, that I should use IDocumentEvents.OpenDocument, that means wait for it. Unfortunatelly he has not explained it to me in details. So that is my question. How can I use those events in Delphi ? Do I have to register them of anything like that ? If somebody knows a better solution than events, please write it too.

thanks, bye
ASKER CERTIFIED SOLUTION
BigRat

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros