AVAX-software.com Forums: Activex under VC6 - AVAX-software.com Forums

Jump to content

Page 1 of 1

Activex under VC6 Using GetHandlesUnderSelectCursor under VC++

#1 User is offline   BMX Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 13-December 07

Posted 13 December 2007 - 01:03 PM

Hello,
I am trying your componenet and found it very interesting.
I would ike using it to select drawing n a drawing and then recover information about these objects (circle center coordinates, ray,...)
(I authorize to select only one object in a time)

I used the SelectChange events that is calling onselectChangeCavax1 method
And then I tryied to recover the handle of the selected item
And than recover the geometry parameters

I had some difficulties to call the GetHandlesUnderSelectCursor method,

Could you please
1- say if I used the correct events
2- Give me an example by using C++ language

Thanks in advance and best regards

BMX,

#2 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 13 December 2007 - 04:27 PM

The events you are using are correct. The end user can select more objects while he is pressing Shift or Alt button at the same time he is clicking on the object.

Here it is a small VC++ example
Athanasios Gardos
Avax-Software.com

#3 User is offline   BMX Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 13-December 07

Post icon  Posted 13 December 2007 - 06:27 PM

View PostAthanasios Gardos, on Dec 13 2007, 07:27 PM, said:

The events you are using are correct. The end user can select more objects while he is pressing Shift or Alt button at the same time he is clicking on the object.

Here it is a small VC++ example

Thanks for the example,
I already had it, and this example only call three methods (Add_Line, Circle, and addDxf)

Unfortunately, I have a problem in handling the routine GetHandlesUnderSelectCursor()
Could you write me a simple use of this routine?

Thanks a lot
Best regards

#4 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 14 December 2007 - 12:11 PM

Here it is an example in VB6 to see how you can use this function.

Option Explicit

Private Sub cAvax1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
	Dim sMsg As String, Handles() As Long
	Dim lCnt As Long, lMax As Long
	lMax = cAvax1.GetHandlesUnderSelectCursor(Handles())
	If lMax > 0 Then
	   For lCnt = 1 To lMax
		   sMsg = sMsg & Format$(Handles(lCnt)) & ", "
	   Next lCnt
	   sMsg = Mid$(sMsg, 1, Len(sMsg) - 2)
	   cAvax1.ToolTipText = sMsg
	   sMsg = "Handles of the objects under select cursor box:" & vbCrLf & sMsg
	Else
	   cAvax1.ToolTipText = ""
	End If
	Label1.Caption = sMsg
End Sub

Private Sub Form_Load()
	cAvax1.StartAvax
	Call cAvax1.Add_Line(0, 0, 0, 10, 10, 0)
	Call cAvax1.Add_Line(0, 10, 0, 10, 10, 0)
	Call cAvax1.Add_Line(10, 5, 0, 10, 10, 0)
	Call cAvax1.Add_Line(10, 5, 0, 5, 10, 0)
	Call cAvax1.Add_Rectangle(0, 0, 12, 10)
End Sub

Private Sub Form_Unload(Cancel As Integer)
	cAvax1.EndAvax
End Sub

Athanasios Gardos
Avax-Software.com

#5 User is offline   BMX Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 13-December 07

Posted 14 December 2007 - 05:58 PM

Dear Athanasios,
I thank you a lot for your help :rolleyes:,
Unfortunately, I Already had the VC++ sample and read the VB help.

I am using VC++ version 6 and I do not use VB

I really hope that you can help.

Here What I wrote,

	SAFEARRAY* V_Handle;
	BOOL fzsort =FALSE;
	long n_items = 0;
	
	 n_items = m_cAvax.GetHandlesUnderSelectCursor(&V_Handle,&fzsort);

		AfxMessageBox( "Control IN");


Actually what happen is that I do not go out from the routine GetHandlesUnderSelectCursor and I never MessageBox anything (AfxMessageBox( "Control IN") is never executed).
Actually it seems like the routine exit from an exception!

I hope thet yu can help because I must decide If I go on with your control.

Thanks a lot and best regards
M Bouri

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users