Author Topic: CommandFlags.Session Crash Form  (Read 1197 times)

0 Members and 1 Guest are viewing this topic.

GumbyCAD

  • Newt
  • Posts: 84
CommandFlags.Session Crash Form
« on: April 17, 2014, 01:39:11 AM »
I have a real complex question (at least  think so).

CommandFlags.Session Vs Not using this

It involves a few things:
  • Form
  • Side Databases
  • ReWritten Code of BlockView.NET sample from AutoDESK as a custom control

In principal its a blockfinder is a tool that findes blocks in certain locations (i.e. Network, Local Drive etc).
It lists the files (say in Control A) and when I select a file (From Control A) it shows a preview in our custom control (Control B) of the drawing.
Also if this selected file (From Control A) has Blocks inside it, it lists them in control C and if selected from that control is also displays a preview (Control B).

If the command is defined with the below method on some machines it crashes when reading the side databases but only on some machines.
Code - Visual Basic: [Select]
  1.     <Autodesk.AutoCAD.Runtime.CommandMethod("BLOCKFINDER", Autodesk.AutoCAD.Runtime.CommandFlags.Session)> _
  2.     Public Sub BlockFinder()
  3.  
  4.         Try
  5.             DisplayDialog()
  6.         Catch ex As Exception
  7.             MsgBox(ex)
  8.         End Try
  9.  
  10.     End Sub
  11.  
  12.     Sub DisplayDialog()
  13.  
  14.         Try
  15.             Dim BlockFinderForm As New BlockFindForm
  16.             Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(BlockFinderForm)
  17.         Catch ex As Exception
  18.             MsgBox(ex)
  19.         End Try
  20.  
  21.     End Sub
  22.  

This case it doesn't.
Code - Visual Basic: [Select]
  1.     <Autodesk.AutoCAD.Runtime.CommandMethod("BLOCKFINDER")> _
  2.     Public Sub BlockFinder()
  3.  
  4.            .....
  5.  

I really just want to understand why this is occuring.
I have read quite a few posts aorund the place and people just say hey if it works do it... But I would like to understand why.

Does anyone else have any experience with this?

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: CommandFlags.Session Crash Form
« Reply #1 on: April 18, 2014, 11:56:23 AM »
If you show the error that helps, document locking is the first thing that comes to mind