Re: Using IWin32Window to SetParent
From: Dan (qqqqq)
Date: 03/15/04
- Next message: Ed Dore [MSFT]: "Re: Which class in EnvDTE is connected with #region ?"
- Previous message: George Yefchak: "Re: Custom controls disappearing"
- In reply to: Ed Dore [MSFT]: "RE: Using IWin32Window to SetParent"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Using IWin32Window to SetParent"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: Using IWin32Window to SetParent"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 15 Mar 2004 17:24:29 -0600
Ed -
Thanks for the response. The same code, today, is working. It's the oddest
thing.
Incidentally, the error was an overflow that was happening on Handle.ToInt32
when I called SetParent to restore the "original" parent. It was in the Hide
method below:
Private Declare Auto Function SetParent Lib "user32.dll" (ByVal Child As
Int32, ByVal Parent As Int32) As Int32
...
Private mlOldParent as Int32
...
Friend Overloads Sub Show(ByVal oOwner As IWin32Window)
Try
mlOldParent = SetParent(Handle.ToInt32, oOwner.Handle.ToInt32)
Catch ex As Exception
mlOldParent = -1
End Try
MyBase.Show()
End Sub
Friend Shadows Sub Hide()
Try
If mlOldParent > 0 Then
Call SetParent(Handle.ToInt32, mlOldParent)
End If
Catch
End Try
End Sub
Dan
""Ed Dore [MSFT]"" <eddo@online.microsoft.com> wrote in message
news:jchiJyrCEHA.1672@cpmsftngxa06.phx.gbl...
> Hi Dan,
>
> Something obviously changed if it was previously working. Probably the
best
> thing to do would be to debug the overflow exception. Can you track down
> and post the section of code that's throwing the exception?
>
> For what it's worth, a better solution might be to create a toolwindow in
a
> VS .Net addin. There are some ToolWindow samples available with the VS
> Automation samples out on:
>
>
>
http://www.microsoft.com/downloads/details.aspx?familyid=3ff9c915-30e5-430e-
> 95b3-621dccd25150&displaylang=en
>
> Sincerely,
> Ed Dore [MSFT]
>
> This post is 'AS IS' with no warranties, and confers no rights.
>
- Next message: Ed Dore [MSFT]: "Re: Which class in EnvDTE is connected with #region ?"
- Previous message: George Yefchak: "Re: Custom controls disappearing"
- In reply to: Ed Dore [MSFT]: "RE: Using IWin32Window to SetParent"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Using IWin32Window to SetParent"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: Using IWin32Window to SetParent"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|