One problem may be that the OpenForm method of your
"Main" class is not shared. If it is not shared, AutoCAD
will create a separate instance of the Main class for each
open document. That's fine, as long as it was not your
intention for the Main class to have application-level
scope (meaning that there is a single instance of it, and
it is used with any document).
If you need to maintain data that is accessed from any
open document, you need to make that data static/shared,
or you must create a single instance of a class when your
app loads, that can be accessed from any context.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
wrote in message news:5079155@discussion.autodesk.com...
Hi Tony
Sorry about that, I just wanted to show one thing at a time. I open the form using vb.net using this method
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Pubic class Main
_
Private sub OpenForm
Dim modalForm As New MyOpenDialog
Application.ShowModalDialog(modalForm)
If modalForm.DialogResult = Windows.Forms.DialogResult.OK Then
OKtoOpen
end Sub
End class
There is a sub OKtoOpen but the error happens before that.
I am using the regular VBnet disposal methods that Visual Studio 2003 adds to the "Windows form generated code" region, the main code looks in my form like this
Private Sub NavigateTo(ByVal url As String, ByVal flag As Integer)
Try
Dim flags As Object = flag
Dim targetFrameName As Object = String.Empty
Dim postData As Object = String.Empty
Dim headers As Object = String.Empty
AxWebBrowser1.Navigate(url, flags, targetFrameName, postData, headers)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
AXwebbrowser1 is a webbrowser control added to the form, it seems that the error while navigating, the weird thing is, there is no error if I do not close any AutoCAD drawing file, I looks like there is any interop. problem.
The error happens after the NavigateTo sub, I can give you more code, if you think it can help,
Thanks for your help