Error in :SetAmbientBGColor

This forum is for eXpress++ general support.
Message
Author
reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Error in :SetAmbientBGColor

#1 Post 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.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Error in :SetAmbientBGColor

#2 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error in :SetAmbientBGColor

#3 Post 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
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Error in :SetAmbientBGColor

#4 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Sbryan
Posts: 31
Joined: Sun Oct 18, 2015 7:15 am

Re: Error in :SetAmbientBGColor

#5 Post 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 14519 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?

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Error in :SetAmbientBGColor

#6 Post by Tom »

A font referenced somewhere is missing on the machine.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Sbryan
Posts: 31
Joined: Sun Oct 18, 2015 7:15 am

Re: Error in :SetAmbientBGColor

#7 Post 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.

Sbryan
Posts: 31
Joined: Sun Oct 18, 2015 7:15 am

Re: Error in :SetAmbientBGColor

#8 Post 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.
Attachments
dchtmltest.zip
(1.26 KiB) Downloaded 692 times

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error in :SetAmbientBGColor

#9 Post by rdonnay »

Sorry, I have been getting behind on this thread.
I wasn't getting my email notifications.

I will look into this today.
The eXpress train is coming - and it has more cars.

Sbryan
Posts: 31
Joined: Sun Oct 18, 2015 7:15 am

Re: Error in :SetAmbientBGColor

#10 Post 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.

Post Reply