Dynamic connector tool is not functioning properly

P

Prasath

Hai,

Thanks for any advice or clues regardin this.
If i invoke a dialogue box in the visio application window,
Dynamic connector tool is not functioning properly
(i.e.) At the start of dragging the connector from the connection point some
interruption takes place oftenly, we cannot able to draw connectors fluently
 
P

Prasath

first of all thanks for your response
Hats off you!
it's an VB6.0 form.
whether there is any problem regarding this.

i will be thankful if you suggest any solution regarding this,
for invoking VB form inside the Visio application.
 
J

junethesecond

It may happen when Visio window is not active.
May be, you need to press connector icon twice,
or connector function not start.

VB6.0 code to activate Visio window is,
appVso.ActiveWindow.Activate
or
appVso.ActiveWindow.zoom=1
 
P

Prasath

hai junethesecond,

Sorry,it is not working
If i invoke a dialog box in the visio application window and using setparent
property i have set the dialog box as the child of the current visio
appliaction window,

after even if i press 1 or 2 or 3 times the dynamic connector tool in the
menubar of visio application the dynamic connector tool mode is activated
if i start drawing connectors ,

At the start of dragging the connector from the connection point sometimes,
interruption takes place ocassionaly, we cannot able to draw connectors
freely.

the free form of drawing connectors is not possible if the dialog box is
present inside the visio activewindow.

if we remove the dialog box from the visio activewindow the free form of
drawing connectors is possible.

Thanks for any suggestions.
 
J

junethesecond

I don't know about the SetParent property.
But, the remark is found in the help document, that
"The new parent window and the child window must belong to the same
application."
Do you think Visio application and VB6 programs are
in the same application?
 
J

junethesecond

I made sample VB program,and tested.
It works well, if you push Command3,
you can start connetor function normally.

Option Explicit

Private Declare Function SetParent Lib "user32.dll" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindow _
Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private appVso As Visio.Application
Private doc As Visio.Document

Private Sub Command1_Click()
If Not appVso Is Nothing Then Exit Sub
Set appVso = New Visio.Application
Set doc = appVso.Documents.Open _
("full path\filename.vsd")
End Sub

Private Sub Command2_Click()
Dim WinhWnd As Long
Dim oldhwnd As Long
WinhWnd = FindWindow(vbNullString, appVso.Window.Caption)
oldhwnd = SetParent(Me.hwnd, WinhWnd)
End Sub

Private Sub Command3_Click()
appVso.ActiveWindow.Activate
End Sub

Private Sub Command4_Click()
appVso.ActiveWindow.Zoom = 0.8
End Sub

Private Sub Command5_Click()
On Error Resume Next
SetParent Me.hwnd, 0&
doc.Close
appVso.Quit
Set appVso = Nothing
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

Private Sub Command7_Click()
SetParent Me.hwnd, 0&
End Sub
 
P

Prasath

hai junethe

Sorry for the late reply.
i have used the windows api GETWINDOWRECT and
timer to maintain the dialog box inside the vsio
application.
if the app window is minimized
i will hide the dialog box otherwise
i will show the dialog box

thanks
 
P

Prasath

another thing junethe

if you use getobject to get the visio application window instead of creating
new visio application then
the above coding you have sent to me
is not working.
the same problem arises.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top