Integrating Visio(or any other Win32 app form) in a Form 
Author Message
 Integrating Visio(or any other Win32 app form) in a Form

Hi All

in Vb6 the following works very well

Public mVis As Visio.Application
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As
Long, ByVal hWndNewParent As Long) As Long

Private Sub Command1_Click()
Set mVis = New Application
SetParent mVis.WindowHandle32, Me.hwnd
End Sub

The Visio application is hosted within the Vb6 form. Great..

Why does this NOT work in It starts Visio but as a disjointed
instance. It will not integrate for some reason.
What am I doing wrong????

Many thanks


*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!

Sun, 12 Dec 2004 19:00:11 GMT  
 Integrating Visio(or any other Win32 app form) in a Form
We've cautioned against using the SetParent API with VB 6 for some time,
even though it does work as expected in some cases.

The following is taken from
Q253814 PRB: SetParent Does Not Change Standard Forms into Child Windows;EN-US;Q253814

"Using the SetParent function to change the ownership of a window in Visual
seldom provides the desired results. Therefore, Microsoft does not
recommend or
support this approach."

Thus there is no guarantee, unfortunately, that using this approach will
work with Visual Studio .Net.

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit

Mon, 13 Dec 2004 04:47:43 GMT  
 Integrating Visio(or any other Win32 app form) in a Form
Given that we both now know this doesn't work in VB.Net could you tell
what does??. Q253814 does not work either for by the way.


*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!

Mon, 13 Dec 2004 21:45:57 GMT  
 [ 3 post ] 

 Relevant Pages 

1. Integrate Visio in VB .NET Application

2. Integrating a data-report-form into a form

3. Opening Visio 2002 modally from a .NET Form

4. Hosting VB.NET controls/forms in a vb6 app

5. VB.NET 7.0 and Win32 apps ?

6. exception on (vb.Net windows forms)

7. VB.NET - Subclassing System.Windows.Forms.Form?

8. How to acess forms controls of one form from other in VB.NET

9. Integrating Non-OLE Apps with VB app

10. How do I integrate Oracle Forms into VB?

11. Integrating VB Forms into Web pages

12. How to Vb Form as child to other app form


Powered by phpBB® Forum Software