Hi Kyle
One of the ways to handle it is to create a global Handle in the oApplication
For example:
Code:
Object oApplication is a cApplication
//Set WorkspaceName to CURRENT$WORKSPACE
Set pbEnterKeyAsTabKey to True
Property boolean pbLL12Registered
Property Handle phChildWorkbook
Procedure OnCreate
Send DoOpenWorkspace CURRENT$WORKSPACE
Set pbPreserveEnvironment to False
End_Procedure
// Set ModuleName to 'ProgramName' // Special module name.
// Set HelpName to 'HelpName.hlp'// Please provide the name of your Windows help file.
End_Object
Handle hAppWS
Move (phoWorkspace(ghoApplication)) to hAppWS
Then I will move the object file handle to that global variable. Often you could do this in the Activate procedure, but you can probably find other ways as well
Code:
Procedure Activate
Handle hObj hClientWorkbook hChildWorkbook hCrisis
Forward Send Activate
Set phMenu of hAppWS to (Self)
Get phClientWorkbook of hAppWS to hClientWorkbook
If (hClientWorkbook=0) Begin
Get Object_Id of (oClientWork(Client_Area(Self))) to hObj
set phClientWorkbook of hAppWS to hObj
End
Get phChildWorkbook of hAppWS to hChildWorkbook
If (hChildWorkbook=0) Begin
Get Object_Id of (oChildWorkbook(Client_Area(Self))) to hObj
Set phChildWorkbook of hAppWS to hObj
End
Get phCrisis of hAppWS to hCrisis
If (hCrisis=0) Begin
Get Object_Id of (oCrisisCall(Client_Area(Self))) to hObj
Set phCrisis of hAppWS to hObj
End
End_Procedure
Then you can access it from any other object:
Code:
// popup an edit panel for the selected row.
Function EditRowPopup Returns Boolean
Boolean bOk
Handle hWorkbook
Integer iInternalNo iClient iRet
//tTableDataLine DataLine
//Get SelectedRowValue of oName to DataLine.sName
Get SelectedRowValue of oChildNumber to iInternalNo
//Get SelectedRowValue of oStatus to DataLine.iSize
Get piClient to iClient
Get phChildWorkbook of hAppWS to hWorkbook
If (iClient>0) Send pLoadChild to hWorkbook iInternalNo
Else Begin
Function_Return bOK
End
Send pPopulateGrid to (Self)
Function_Return bOk
End_Procedure