axDrawingControl not responding on Save

Started by IRDC, August 13, 2012, 10:26:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IRDC

Hi, I'm using the Visio 2010 axDrawingControl within my .Net Windows Forms application and sometimes (about 1 in 5 to 10 calls) on calling the DrawingControl.Document.SaveAs() method Visio will no longer respond. It drains no CPU power but does not save the file or return control back to the application. This happens on all our machines. It got better when I added these lines before the SaveAs() call:


GC.Collect();
GC.WaitForPendingFinalizers();
this.VisioDrawingControl.Focus();


But it still happens. Which means an application crash and inconsistent data.

Has anybody experienced such a problem before and knows a fix or workaround?

aledlund

I haven't seen it. Do you have it wrapped in a try...catch...endtry to see if it's failing? After the save do you test to see if the document status is 'saved'. When it fails has the document been saved? Are you saving locally or to a network drive (goes to an undetected network event)?
al

IRDC

Hi aledlund,
a try/catch won't help since no error occurs. The application just waits for Visio to come back from the saveas call. The file is not saved (locally). As mentioned this does not happen every time. Same location, same drawing control is working fine for some time.

aledlund

What are the chances that another user may be going against the same file? Is this saved as a network file or going against sharepoint? IME (knowing that it is being saved at a network level), I would set the save as a separate routine which wraps the process in a timer (based on the expected file size). If the timer pops before the save completes post as a probable network event.
al

IRDC

It is saved locally on a machine with no access by other users.

Visio Guy

Just to chime in, the Visio control loads a copy of the drawing, so I'm not sure that the Saved flag will get properly set. It might function just fine as a "dirty" flag.

Since it opens a copy, you should be able to open it even if someone else is using the file (I think), but saving would be problematic. A typical scenario would be opening the file in Visio to do some work that can't be done in the control. A save from the control would then cause problems.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

IRDC

ATM it seems to work. I just had to create a new Drawing Control every time I wanted to open a new file...

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 238 (show)
Files included: 34 - 1321KB. (show)
Memory used: 1098KB.
Tokens: post-login.
Cache hits: 11: 0.00199s for 26,572 bytes (show)
Cache misses: 1: (show)
Queries used: 14.

[Show Queries]