bBrowser errors

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
Post Reply
ic2
Posts: 1809
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

bBrowser errors

Post by ic2 »

I was trying to solve some issues, see https://www.xsharp.eu/forum/public-prod ... ing-horror. It looked like the default installation of bBrowser consists of Debug instead of Release versions.

To be sure I tried to create the bBrowsers DLL's from the source. Unfortunately that ends in the following compiler error, in bConvertLogicToUsual:

Error XS9109 Argument 3 may not be passed with the '@' prefix

Code: Select all

if IsLogic(uValue)  .and. !IsLogic(uTemp)
    if bConvertLogicToUsual(uValue, self:PropertyGet(#LogicValueIdentifier, NULL_ARRAY), @uTemp)
       uValue := uTemp
    endif
endif
1 Not sure how I solve this without compromising the working. It is also a bit frustrating that this latest download (although from april 2021) isn't compiling in the latest X#.
How do I solve this?

2 The next step I tried is to re-include the latest bBrowser DLL in our project, from C:Program Files (x86)bBrowser.NET 4 (XSharp Edition)Assemblies. If I do that VS complains that the .Net version (of the bBrowser DLL's) is newer than the version of my project. VS doesn't tell me the actual versions, that was too much effort for the programmers, but I changed the project 4.7 which seemed fine. However, it looked like VS doesn't have any problem with a solution full of 4.6 based projects!

Why do I get a warning when I add a reference of a DLL targeting a newer .Net version but can I simply continue with everything else on the previous target version? Can't I change all target version at once for example?

3 As written I eventually ended up bDataColumn (Class).prg appearing in VS during my debug because it crashed at line 1250 (See some lines of the code, the last line is where it crashed) with the error below it. What is wrong with that?

Code: Select all

	access Value as usual
		// aktuellen Spaltenwert zurückgeben
		local uValue				as usual
		local cbEBPrevious		as usual

		// Wert ermitteln
		cbEBPrevious := ErrorBlock({|| _Break(NIL)})

Code: Select all

XSharp.Internal.WrappedException
  HResult=0x80131500
  Message=Exception of type 'XSharp.Internal.WrappedException' was thrown.
  Source=XSharp.RT
  StackTrace:
   at XSharp.RT.Functions._Break(__Usual uValue)
   at bTools.bBrowser.bDataColumn.<>c.<get_Value>b__107_0() in C:TempVisual Studio 2019bBrowser.NET 4 (XSharp Edition)bBrowserColumnsbDataColumn (Class).prg:line 1520
   at <>f__AnonymousType0.Eval(__Usual[] Xs$Args)
   at XSharp.RT.Functions.Eval(ICodeblock block, __Usual[] args)
   at XSharp.RT.Functions.Eval(__Usual uCodeBlock, __Usual[] args)
   at VO.DbServer.Error(__Usual[] Xs$Args)
   at VO.DbServer.FIELDGET(__Usual[] Xs$Args)
Dick
User avatar
robert
Posts: 4279
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

bBrowser errors

Post by robert »

Dick,
A quick reply

1) To pass variables by reference with the @ operator you need to set the compiler option /vo7. Or you need to change the @ to the REF keyword
2) No
3) The codeblock that is assigned to cbEBPrevious calls _Break(). When the codeblock is evaluated inside the BDataColumn:Value access the exception occurs.
The _Break() function is part of the BEGIN SEQUENCE.. RECOVER .. END construct in VO.
Such as construct does not exist in .Net.
We are emulating by generating a special kind of TRY .. CATCH .. ENDTRY and with a special kind of exception (XSharp.Internal.WrappedException)
This compiler generated TRY .. CATCH catches the "special" exception and gets the value out of the exception.
Apparently there is no TRY .. CATCH .. ENDTRY in your app and no BEGIN SEQUENCE .. RECOVER.. END as well, so you get the error.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4593
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

bBrowser errors

Post by Chris »

Hi Dick,

To add to what Robert said, if I recall correctly, there was a bug in bBrowser, which was found recently. In line 528 of MiscbTools (Func).prg, there,s the definition:

function bConvertLogicToUsual(lValue as logic, uConvertRule as usual, uValue as usual) as logic pascal

this was a typo in the code wrong, the last parameter is supposed to be passed by reference, so REF should be used instead of AS:

function bConvertLogicToUsual(lValue as logic, uConvertRule as usual, uValue ref usual) as logic pascal

Make this change, and the bBrowser solution will compile with no errors (although with some warnings in the latest X# build, but you can ignore those).
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1809
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

bBrowser errors

Post by ic2 »

Hello,
robert post=23175 userid=253 wrote: 1) To pass variables by reference with the @ operator you need to set the compiler option /vo7. Or you need to change the @ to the REF keyword
I had an error XS0208 Cannot take the address of, get the size of, or declare a pointer to a managed type which could also easily be solved by replacing the @ by REF. But when I checked this I realized that I don't know where to 'set a compiler option /vo7' (should I have whished so).

I seem to remember that clicking in the project from Solution Explorer, right mouse, properties and then that the Language or Dialect settings had such a compiler option between brackets. Or am I looking at the wrong place? If so, how else or where am I supposed to set the compiler options?

Dick
User avatar
Chris
Posts: 4593
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

bBrowser errors

Post by Chris »

Hi Dick,

This is the checkbox in Dialect/Implicit casts and conversions
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1809
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

bBrowser errors

Post by ic2 »

Hello Chris,

Thanks.

Am I right when I seem to remember that in older versions /vo7 was added to that checkbox caption? If in messages /vo7 is communicated as the solution and we can find that nowhere, it is going to be a bit difficult :unsure:

Dick
User avatar
Chris
Posts: 4593
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

bBrowser errors

Post by Chris »

Hi Dick,

XIDE has it in the checkbox caption, while VS has it in a tooltip when you hover over the checkbox.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1809
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

bBrowser errors

Post by ic2 »

Ah!

That's were I saw it, thanks.

Dick
Post Reply