Page 1 of 2

Error in :SetAmbientBGColor

Posted: Fri Nov 25, 2011 3:10 am
by reganc
I think this will probably turn out to be an Alaska question but I'll ask it here first, just in case anyone else has seen it.

It is regarding an error that is happening occasionally on our dialogs that use an XbpHtmlViewer object via DCHTMLVIEWER (although that fact may be irrelevant):

Code: Select all

------------------------------------------------------------------------------
ERROR LOG of "D:\SHARED\Programs\RBA\rba32.exe" Date: 24/11/2011 17:07:28

Xbase++ version:Xbase++ (R) Version 1.90.355
Operating system:Windows Server 2003 05.02 Build 03790 Service Pack 2
------------------------------------------------------------------------------
oError:args         :-> VALTYPE: O - CLASS: DC_XbpHTMLViewer
                     -> VALTYPE: N - VALUE: -255
oError:canDefault   :.F.
oError:canRetry     :.F.
oError:canSubstitute:.T.
oError:cargo        :NIL
oError:description  :Internal data structures corrupted
oError:filename     :
oError:genCode      :41
oError:operation    ::SetAmbientBGColor
oError:osCode       :0
oError:severity     :2
oError:subCode      :5
oError:subSystem    :BASE
oError:thread       :11
oError:tries        :0
------------------------------------------------------------------------------
CURRENT DATABASE:
------------------------------------------------------------------------------
Alias(): DELIV2  Record: 1789  Index: 2,DELIV2P
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from (B)ERRORSYS(54)
Called from XBPACTIVEXCONTROL:INHERITPRESPARAMS(4318)
Called from XBPACTIVEXCONTROL:PRESPARAMCHANGED(2655)
Called from XBPACTIVEXCONTROL:HANDLEEVENT(2030)
Called from XBPHTMLVIEWER:HANDLEEVENT(6574)
Called from DC_GETLIST:EVENTLOOP(4449)
Called from DC_GETLIST:READGUI(3677)
Called from DC_READGUI(101)
Called from ENQUIRY(522)
Called from (B)XB_MENU(544)
Called from RUNFUNCTION(76)
Called from (B)RUN_PROCEDURE(63)
------------------------------------------------------------------------------
RBA SPECIFIC INFO:
------------------------------------------------------------------------------
Unique error ID:      25063
Folder: d:\shared\programs\rba\live
Rba Version: 10.80.0012 (09/10/2011)
Express++ Version: eXPress++ (c) Version 1.9 Build 255
I cannot see any mention of any such method anywhere in the documentation or anywhere else.

Re: Error in :SetAmbientBGColor

Posted: Fri Nov 25, 2011 3:24 am
by Tom
Hi, Regan.

I remember we had that problem, it was caused by DCHtmlViewer trying to set a non-existing default font, "Helvetica" or so. AFAIK, we removed it by setting something like "8.Arial" as the standard font within DC_GetOptDefault or the GetOptions for the dialog containing the viewer.

Re: Error in :SetAmbientBGColor

Posted: Fri Nov 25, 2011 8:38 am
by rdonnay
Tom -

I just looked at my source code for DCHTMLVIEWER.

There is nothing in DCDIALOG.CH or _DCCLASS.PRG that assigns a font.
A font would not be a viable option for a web browser.

Please clarify what you mean.

Roger

Re: Error in :SetAmbientBGColor

Posted: Fri Nov 25, 2011 9:07 am
by Tom
Hi, Roger.

I'm sorry, but I'm not able to clearify this, since it's too long ago. But I'm sure we had that "SetAmbientBGColor"-phenomenon and it was in conjunction with a wrong font setting. Maybe it was not in your but in my code - anyway, setting a(nother) font fixed it.

Re: Error in :SetAmbientBGColor

Posted: Thu Jun 06, 2019 8:23 am
by Sbryan
I realize this is a very old thread but I just ran into this same problem.

I'm trying to use DCHTMLVIEWER on a tab page to display some html which has been stored in a field using:

@1,10 DCHTMLVIEWER oHTML PARENT oTabPage2 SETHTML oItem:descrip SIZE 100,16

It works fine until I attempt to resize the window and then get the attached error.
ResizeError.JPG
ResizeError.JPG (61.19 KiB) Viewed 14739 times
I'm using these get options:
DCGETOPTIONS RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE_SCALEFONT

If I use DCGETOPTIONS RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE I don't get the error but of course, it doesn't scale the fonts.

I've tried using the DEFAULTFONT '10.Arial' option but it doesn't help.

Any thoughts on how I can get around this?

Re: Error in :SetAmbientBGColor

Posted: Thu Jun 06, 2019 8:38 am
by Tom
A font referenced somewhere is missing on the machine.

Re: Error in :SetAmbientBGColor

Posted: Thu Jun 06, 2019 11:04 am
by Sbryan
I scaled down my application to make it easier to test and went through and eliminated any font references but still get the error on resize.

It only happens when I try to place DCHTMLVIEWER inside a DCTABPAGE. If I place it outside the Tab it resizes correctly.

I'm hoping there's a way around this so I can use it inside a tab page.

Re: Error in :SetAmbientBGColor

Posted: Thu Jun 06, 2019 12:05 pm
by Sbryan
I attached a simple test program that shows the problem. It's just a DCHTMLVIEWER with a DCTABPAGE as the parent.

If you attempt to resize the window the error pops up.

Re: Error in :SetAmbientBGColor

Posted: Wed Jun 12, 2019 6:03 am
by rdonnay
Sorry, I have been getting behind on this thread.
I wasn't getting my email notifications.

I will look into this today.

Re: Error in :SetAmbientBGColor

Posted: Wed Jun 12, 2019 11:58 am
by Sbryan
Since others have run into this error with DCHTMLVIEWER you may want to figure out what's happening but in my situation, I found it better to use DCHTMLWINDOW since I was just displaying html that was stored in a memo field.

It took a little figuring out to understand how to refresh the screen when I changed records but finally got it working after finding a sample. The best part is, no error when resizing.