How to Use Debug mode

using the DataFlex development, by that using the DLL interface

Using DebWin4 to sort out a problem.

It reports:

<LlPrintGetOptionString() → -18 (0xffffffee) (Parameter error. Please use debug mode to determine the error.)

If have set the debug mode to

LlSetDebugEf to LL_DEBUG_CMBTDWG and the debug mode is on.

So see all messages in Dedbwin4.

So I must be missing something because it still complains……

Peter

Can you paste the full context? Usual suspects would be using an invalid option constant or querying a print option without actually printing. A full log should help to troubleshoot the issue.

Here the log of the Dataflex sample application

Peter

Debwin4.txt (89.6 KB)

This

INFO  CXLL31     LL.API          4CD4     18.02.2026 06:40:42.932 >LlPrintGetOptionString(1,18==<internal>,0000000005E102F4,1024) 27743                     6 
INFO  CXLL31     LL.API          4CD4     18.02.2026 06:40:42.932 <LlPrintGetOptionString() -> -18 (0xffffffee) (Parameter error. Please use debug mode to determine the error.) 27744                     12
INFO  CXLL31     LL.API          4CD4     18.02.2026 06:40:42.932 >LlPrintSetOptionString(1,17:<internal>,'PRV;HTML') 27745                     12
INFO  CXLL31     LL.API          4CD4     18.02.2026 06:40:42.932 <LlPrintSetOptionString() -> -18 (0xffffffee) (Parameter error. Please use debug mode to determine the error.) 27746                     12
INFO  CXLL31     LL.API          4CD4     18.02.2026 06:40:44.219 >LlPrintGetOptionString(1,18==<internal>,0000000005E102F4,1024) 27747                     10
INFO  CXLL31     LL.API          4CD4     18.02.2026 06:40:44.219 <LlPrintGetOptionString() -> -18 (0xffffffee) (Parameter error. Please use debug mode to determine the error.) 27748                     10

looks like it should rather be a call to LlGetOptionString or LlSetOptionString. Then, the constants passed would make more sense as they would resolve to

#define LL_OPTIONSTR_EXPORTS_AVAILABLE (17                  ) /* r/o */
#define LL_OPTIONSTR_EXPORTS_ALLOWED   (18                  )

I was unable to find these calls in our DataFlex sample - are you positive they’re in there? Can you give me the full file name of the source file in this case?

tldr: change the call to use LlSetOptionString and LlGetOptionString and move the calls before LlPrint(WithBox)Start. That should help.

Here is the source I was toying with to sort out how I want my framework to work/look and feel

Just send did not look at you remarks.

LLInvoice.zip (5.1 KB)

Replace in the sample.

I always used Crystal. So wanted a bit or the same look and feel

This is my preview.

Will now look at you remarks

Peter

Use it the following way

Then use the print button

Peter

If I move it before the

LLPrintWithBoxStart

Call I get -4 as result “Print job not opened, no Print Object”

Peter

Here’s the culprit:

        If (iDest=LL_PRINT_EXPORT) Begin              
            //LlSetOptionString(hJob, LL_OPTIONSTR_EXPORTS_ALLOWED,"PRV;HTML");    
            
            String sDummy_1
            String sDummy_2
            
            Get LLPrintGetOptionString of hoLL LL_OPTIONSTR_EXPORTS_ALLOWED to sDummy_1
          
            Get LLPrintSetOptionString of hoLL LL_OPTIONSTR_EXPORTS_AVAILABLE "PRV;HTML" to iRet
            
            Get LLPrintGetOptionString of hoLL LL_OPTIONSTR_EXPORTS_ALLOWED to sDummy_2

This should actually be LlSet... and LlGet... just like in the comment that’s also present. And it needs to be called earlier, here:

        // Start the Report

//-> Insert the calls here!

        Get LLPrintWithBoxStart of hoLL iProjectType sFile iDest LL_BOXTYPE_EMPTYABORT hWnd "Printing Records" to iRet

Can you double-check?

Ok no more error, but it is not doing what I try to achieve.

When you click on export you get the following

I only want to show the ones I want to allow. This is for the average end user to overwhelming

Sorry got it working

Peter