Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Setting a handle on a User Form
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Setting a handle on a User Form

 Post Reply Post Reply
Author
Message
PhilJeary View Drop Down
Newbie
Newbie
Avatar

Joined: 16 March 2004
Location: United Kingdom
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote PhilJeary Quote  Post ReplyReply Direct Link To This Post Topic: Setting a handle on a User Form
    Posted: 23 August 2006 at 12:49pm
Hi all,
 
I had a form (frmMain) with the following:
 
Public A As Pane, B As Pane
 
Both are set up as follows:
Set A = DockingPaneManager.CreatePane(1, 250, 120, DockLeftOf, Nothing)
A.Handle = frmTreeViewPane.hWnd
Set B = DockingPaneManager.CreatePane(2, 800, 400, DockRightOf, A)
B.Handle = frmSelections.hWnd
frmTreeViewPane contains a shortcutbar with the following Forms that get displayed:
 
    Set ItemSelections = wndShortcutBar.AddItem(1, "Selections", frmSelectionsPane.hWnd)
    Set Item = wndShortcutBar.AddItem(2, "User Tables", frmUserTablesPane.hWnd)
    Set Item = wndShortcutBar.AddItem(3, "Reports", frmReportsPane.hWnd)
    Set Item = wndShortcutBar.AddItem(4, "Schedules", 0)
    Set Item = wndShortcutBar.AddItem(5, "Export Tables", frmExportTablesPane.hWnd)
 
When one of the shortcuts is selected, the following runs which displays the selected form on the B pane:
 
Select Case Item.Id
Case 1
    frmMain.B.Handle = frmSelections.hWnd
Case 2
    frmMain.B.Handle = frmUserTables.hWnd
Case 3
    frmMain.B.Handle = frmReports.hWnd
Case 5
    frmMain.B.Handle = frmExpDataSetup.hWnd
 
My Point......
 
While this works fine as a stand alone Exe project, if I try and convert it to an OCX, thus making frmMain a User Control it stops working.
 
Setting the handles in the user control and the handle changes in frmTreeViewPane work fine, but these ones don't work:
    frmMain.B.Handle = frmExpDataSetup.hWnd
    etc
 
I assume it's because I'm referencing the User Control from the outside.  A and B Panes were declared as public but still it returns
 
Object variable or With block variable not set
 
Does anyone have any idea where i'm going wrong?
 
Hopefully i've described that well enough but if anything is unclear please let me know.
 
Regards,
Phil
 
 
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.188 seconds.