inner Posted February 21, 2010 Posted February 21, 2010 i have a lot of dlls in vb6 that work like a charm from autocad 2004 to autocad 2009 but now im having a lot of problems with AutoCAD 2010 schema of all VB6 dlls is Initialize Class Show a Form in vbModal (if i try to do it modeless then Form does not appear) Press Run Command Button, hide form, send a prompt to autocad and try to make a selection on screen but then AutoCAD is blocked, selection cursor appears on screen but i cant do anything and must terminate autocad from windows task manager this problem does not happen when i make a selectonscreen from a vb6 dll with no forms anyone knows what is happening with AutoCAD 2010? do not want to rewritte all code in NET Quote
ReMark Posted February 21, 2010 Posted February 21, 2010 32-bit or 64-bit version? We are talking VB 6.0 with Service Pack 5 right? Quote
inner Posted February 21, 2010 Author Posted February 21, 2010 32 bits VB6 SP6 something like this just block autocad 2010 in my computer Test.zip Quote
ReMark Posted February 21, 2010 Posted February 21, 2010 Just so I am clear on this, both AutoCAD 2010 and VB 6.0 are 32-bit right? Quote
inner Posted February 21, 2010 Author Posted February 21, 2010 yes it is so strange, cos it works nice while debugging dll, but not after compilling dll i changed the code this way Private Sub Command1_Click() Dim objSelset As AcadSelectionSet On Error GoTo ErrControl '::::::::::::::::::::::::::::::::::: Me.Hide LimpiaDibu Set xAcad = GetObject(, "AutoCAD.Application.18") Set ThisDrawing = xAcad.ActiveDocument Set objSelset = ThisDrawing.SelectionSets.Add("SS2") objSelset.SelectOnScreen MsgBox objSelset.Count exithere: Me.Show On Error Resume Next ThisDrawing.SelectionSets.Item("SS2").Delete: Set objSelset = Nothing Err.Clear Exit Sub ErrControl: MsgBox "Error en MenuTest. " & Err.Number & " (" & Err.Description & ") de " & Err.Source, vbCritical, "eRROR" Err.Clear Resume exithere End Sub Quote
inner Posted February 21, 2010 Author Posted February 21, 2010 i found the problem i must place inside EVERY SUB Set xAcad = GetObject(, "AutoCAD.Application.18") Set ThisDrawing = xAcad.ActiveDocument but in autocad2004 to 2009, i only need to place it on UserForm_Initialize() just only one time ?¿ Quote
ReMark Posted February 21, 2010 Posted February 21, 2010 Well I'm glad you found a solution to your problem even though on the surface of it one would wonder why the code had to be tweaked to work in AutoCAD 2010. Thank you for sharing the solution with us and for updating us. Quote
inner Posted February 21, 2010 Author Posted February 21, 2010 you're welcome ill try to spent some time in this community Quote
ReMark Posted February 22, 2010 Posted February 22, 2010 you're welcome ill try to spent some time in this community We certainly encourage everyone's involvement including yours. Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.