System is Windows Vista / Windows XP (2 machines).
CTD is V 4.2
I have this menu program that is nothing more than a series of SalLoadApp's and works fine on all programs... in SOME ways. But my report APPs that use SalReportView are behaving weird.
For instance, in any of my report APPs
1) In Debug <F7> mode, the report comes out fine.
2) In Windows, running the built .EXE comes out fine.
3) From the menu program that does the SalLoadApp, the EXE is loaded fine. I can select whatever criteria there is, but when I process the SalReportView function, I notice that it totally bypasses the SAM_ReportStart, SAM_ReportFetchInit and SAM_ReportFetchNext sections completely. I confirmed this by putting SalMessageBox's inside them, and they were never executed at all, whilst in 1) and 2), they worked fine.
This sounds like something's wrong with my menu program but I could be wrong. Problem is, the report EXE loads fine just like all other EXEs. What is it that could possibly cause this problem?
Below are the relevent code segments :
Code: Select all
REPORT MENU
-----------
Global Declarations
!!CB!! 28
On SAM_AppStartup
Set strProgramName = 'MAINMENU'
Set strVersion = 'V1.00'
Set bCombo = TRUE
Set strArgArray[1] = 'WEIGH'
If SalModalDialog( dlgLogin, hWndNULL, strUser, strPassword ) = 0
Set strArgArray[2] = strUser
Set strArgArray[3] = strPassword
Set strLoginStr = strArgArray[1] || ' ' || strUser || ' ' || strPassword
If InitUser( )
Else
Call AccessError( )
Form Window: frmReportMenu
Contents
cpb: pbUsers
Message Actions
On SAM_Click
Call SalLoadApp( 'USERLST.EXE', strLoginStr )
======================================
UserLst.App
-----------
Form Window: frmMain
Contents
Pushbutton: pbView
Message Actions
On SAM_Click
Set strSelCrit = ' '
Call FormSortSeq( )
Set strSqlFinal = strSelect || strSelCrit || strSqlSort
Call SalMessageBox( 'Just before SalReportView' ) ; This msg is shown always
Call SalReportView( frmMain, hWndNULL, 'UserLst.QRP', strRptVars, strInpItems, nReturn )
Call Prompt( 'back from SalReportView' ) ; This msg is shown always
Message Actions
On SAM_Create
On SAM_ReportStart
Call SalMessageBox( 'inside SAM_ReportStart', '', MB_Ok ) ; This is shown during <F7>, Windows Run but not from SalLoadApp
Call SqlPrepare( hSqlTemp, strSqlFinal )
On SAM_ReportFetchInit
Call SalMessageBox( 'inside SAM_ReportFetchInit', '', MB_Ok ) ; This is shown during <F7>, Windows Run but not from SalLoadApp
If SqlExecute( hSqlTemp )
Return TRUE
On SAM_ReportFetchNext
Call SalMessageBox( 'inside SAM_ReportFetchNext', '', MB_Ok ) ; This is shown X times during <F7>, Windows Run but not from SalLoadApp
If SqlFetchNext( hSqlTemp, nReturn )
Return TRUE
UserLst.App is built as UserLst.exe
Any ideas, guys?
Thanks