Jump to content

Recommended Posts

Posted

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

Posted

32-bit or 64-bit version?

 

We are talking VB 6.0 with Service Pack 5 right?

Posted

32 bits

 

VB6 SP6

 

something like this just block autocad 2010 in my computer

Test.zip

Posted

Just so I am clear on this, both AutoCAD 2010 and VB 6.0 are 32-bit right?

Posted

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

Posted

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

 

?¿

Posted

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.

Posted

you're welcome

 

ill try to spent some time in this community

Posted
you're welcome

 

ill try to spent some time in this community

 

We certainly encourage everyone's involvement including yours. Thanks.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...