Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Forms Lost after loadstate?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forms Lost after loadstate?

 Post Reply Post Reply
Author
Message
stuc View Drop Down
Groupie
Groupie


Joined: 05 May 2011
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote stuc Quote  Post ReplyReply Direct Link To This Post Topic: Forms Lost after loadstate?
    Posted: 11 August 2011 at 11:17am


I need a pointer in the right direction if I could.

What would cause the panes to loose their forms?

i.e. After a loadstate, the panes are correctly in their positions its just they are all devoid of their forms

I used the samples for my template and cant for the life of me see why this would happen? - I cant get it to happen with the example code.  Im searching line by line to see what differences I have made. 

A pointer in the general area would be nice
Back to Top
stuc View Drop Down
Groupie
Groupie


Joined: 05 May 2011
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote stuc Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2011 at 3:47am

[SOLVED]  my mistake thought Id post just in case others find the same.

Incorrect Code

Private Sub DockingPaneManager_AttachPane(ByVal Item As XtremeDockingPane.IPane)

'If Form not create yet.
    If arrPanes(Item.id) Is Nothing Then
        Set arrPanes(Item.id) = frmpandid
           Item.handle = arrPanes(Item.id).hWnd
    End If
End Sub


As you can see I was assigning the Pane handle  (item.handle) only when the array was not populated.  On a loadstate the panes must be being deleted and recreated as it looses the handle.

Corrected code


Private Sub DockingPaneManager_AttachPane(ByVal Item As XtremeDockingPane.IPane)

'If Form not create yet.
    If arrPanes(Item.id) Is Nothing Then
        Set arrPanes(Item.id) = frmpandid
    End If

      Item.handle = arrPanes(Item.id).hWnd       '<<<<<<<<

End Sub

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.