Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[v8i SS4 C#] Cannot open lots of files with print dialog open

$
0
0

We have a print addon for MicroStation that have worked on MicroStation v8i for many years. But now with ss4, if we try to select many files (10+), MicroStation crashes with the following error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 

I have tried with new empty files to make sure that it's not corrupt files that causes the crash.

It's not easy to reproduce, but the code below will crash when I run in debug. The strange thing is that it only crashes if I have the print dialog open. If I comment out the first line, the code runs fine.

BIM.Session.Instance.Keyin("MDL LOAD PLOTDLG SILENT "); // works if this line is deleted
OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "MicroStation DGN Files (.dgn)|*.dgn|AutoCAD Drawing Files (.dwg)|*.dwg|All Files (*.*)|*.*"; dialog.Multiselect = true; if (dialog.ShowDialog() != DialogResult.OK) return; foreach (string fileName in dialog.FileNames) { mainAddin.Instance.App.OpenDesignFile(fileName, false, BCOM.MsdV7Action.Workmode); }

If someone can reproduce this behaviour, its great. And if someone has a solution, it's even better.

Frode


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>