How to use Bbrowser.Net in my Application?

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
Post Reply
User avatar
Intexso
Posts: 84
Joined: Mon Sep 10, 2018 3:19 pm
Location: Nederland

How to use Bbrowser.Net in my Application?

Post by Intexso »

Hello,

I just downloaded Bbrowser.NET and installed it on my machine. (I have chosen for the Vulcan 3 option).

I am porting my VO application to X# and am working in XIDE.

In VO I used bBrowser standard and used bBrowser and bArrayserver. In my application I made 2 classes which inherited from this classes.

I tried to add the Assemblies bTools.bBrowser.dll and bTools.bServer.dll, but this didn't work.

What'is the best way to embed bBrowser in my application?

Eric
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

How to use Bbrowser.Net in my Application?

Post by robert »

Eric,
Can you be a more specific then "this didn't work". What was the error message that you got? Did you include the bBrowser header files in your code? Did you include the USINGs for bTools.bServer and bTools.bBrowser?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

How to use Bbrowser.Net in my Application?

Post by wriedmann »

Hi Eric,

I'm using the bBrowser in some of my ported VO applications, and since I have the source code version, I have also recompiled it with X#.

If you have the Vulcan 3 runtime, you need also the Vulcan 3 version of the bBrowser - this was an issue in VO and also in Vulcan.

Wolfgang
bbrowser_xsharp.png
bbrowser_xsharp.png (60.04 KiB) Viewed 542 times
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Intexso
Posts: 84
Joined: Mon Sep 10, 2018 3:19 pm
Location: Nederland

How to use Bbrowser.Net in my Application?

Post by Intexso »

Hello Robert,

Sorry. The error message was:
error XS0246: The type or namespace name 'BBrowser' could not be found (are you missing a using directive or an assembly reference?) 2,1 Klasse BBrowserSIKOS.prg itxAlgemeen
I added to my code
USING bTools.bBrowser
USING bTools.bServer

and now it seems to work (I have a lot of work to do before my application will run and I can really test it).

It is not yet clear to me when USING should be used and when adding a reference is sufficient...

@Wolfgang: I chose the Vulcan 3 version of bBrowser, but I never worked with Vulcan, so I don't know the differences. Are the runtimes used in X# more Vulcan 2? And is it better to use the Vulcan 2 version of bBrowser?

Eric
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

How to use Bbrowser.Net in my Application?

Post by wriedmann »

Hi Eric,

the source of the bBrowser should bet the same between Vulcan 2, 3 and 4. It depends only on the version of the Vulcan runtime you have.

Regarding your question about namespaces: please look here for an explanation: https://docs.xsharp.it/doku.php?id=name ... _reference

If this leaves questions, please let me know and I will extend the description.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

How to use Bbrowser.Net in my Application?

Post by robert »

Eric,
The DotNet framework contains many many classes. To avoid name conflicts these classes are organized inside "collections". That are the namespaces.

In VO we did not have that. That is why 3rd party products often start their classnames with specific characters. RP for ReportPro, b for BBrowser and Ado for Vo2Ado.

Like the article from Wolfgang says: by adding a using statement you tell the compiler in which collections to search. And you have to also add the assembly to the list of references.

In the Vulcan runtime the classes like DbServer and DataWindow are part of the Vulcan.VO namespace.
To make it easier for people migrating from VO we have added a special mechanism to the Vulcan compiler in the past and now also to the X# compiler: an assembly can add an attribute that lists namespaces that should be treated as "implicit". And we have added a compiler option that intructs the compiler to automatically add these "implicit namespaces" as using statements to your code.
If you check the properties of your application you will see that the transporter has enabled this option, so you can still use classes like DbServer and DataWindow without including using statements for these classes.
Vn2Ado also uses this mechanism. If you enable this option then you can use the Ado.. classes without extra using statement.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply