RE: Specifying Parent to a Windows Form Where Parent Form is in VB by calsep
calsep
Tue May 09 07:57:02 CDT 2006
Hi Peter,
Thanks for your posting!
Your understanding of my post is right on!
I undertand the mechanism behind VB6, VB.NET and the .NET Interop and I
completely agree with you. I also understand the consequences of breaking the
internal relation of VB6 with its forms in case the Win32 API is used. The
best option as you suggest is to upgrade the entire VB6 project to .NET but
that is not going to be possible for our case. Our main goal will be to have
everything in .NET but in the meantime we would like to take advantage of the
interop to put new things in .NET and do the conversion bit by bit. This
scenario will prompt situations like the one I am trying to overcome
considering its limitations.
I am still interested in knowing how to use the Win32 API to force the .NET
form as a children of VB6 MDI (assuming the corresponding consequences and
limitations).
Thanks in advance!
Jairo
> parent Form
""Peter Huang" [MSFT]" wrote:
> Hi Jairo,
>
> Thanks for your posting!
> Based on my understanding, you want to create a .NET form via COM Interop
> and use that form in VB6. That is OK.
> But when you try to set the .NET form as a children form of a VB6 MDI form,
> you will get error.
>
> If I have any misunderstanding, please feel free to post there.
>
> Based on my research, this is by design. Because VB6 Form is different from
> .NET form, we can consider them as different class. While the VB6 MDI
> parent wants a vb6 form, it gets a .NET form which will cause unexpected
> error.
>
> Also we may use Win32 API to force the .NET form as a children of VB6 MDI
> parent Form, but that will break the internal relation VB6 maintain for its
> own VB6 form.
> So this behavior is not supported.
>
> Here I just wonder why you need to do so.
>
> I suggest you upgrade your VB6 project to VB.NET project so all the code
> will be pure .NET.
>
> If you still have any concern, please feel free to post here.
>
> Best regards,
>
> Peter Huang
>
> Microsoft Online Community Support
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>