fbpx

bBrowser

More
10 months 5 days ago #1 by Gianluca Pinoli
bBrowser was created by Gianluca Pinoli
Hi everyone,
I'm a newbie with X# (and .NET in general).
I'm trying to use bBrowser 4.0 for Vulcan in X# but I Always get a general error.
Has anybody a sample to share?

Regards
Gianluca

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #2 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser
Hi Gianluca,

bBrowser for Vulcan should work in X#, and it should also compile in X# (with a few corrections).

Where do you get the general error? Compiling? Running?

Please specify better what your problem is.

Wolfgang

P.S. this is a bBrowser in a xPorted VO application (running in X#):
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #3 by Gianluca Pinoli
Replied by Gianluca Pinoli on topic bBrowser
Hi Wolfgang,
i tried restarting with a new project in XIDE.
in the images below you can see my simple app, i suspect the problem is the ResouceID, but i can't find a solution.
By the way the bTools.xxx.dll are compiled following your (really appreciated) guide.

Thank You very much for your help.

Gianluca
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #4 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser
Ciao Gianluca,

please try to log your exception somewhere. On the image it is really hard to try.

I'm using this code for this purpose:
static method ProcessException( oException as Exception ) as void
local cMessage as string
	
cMessage := oException:Message
VOXSErrorHandler.WriteErrorLog( oException )
do while oException:InnerException != NULL_OBJECT
  oException := oException:InnerException
  VOXSErrorHandler.WriteErrorLog( oException )
  cMessage += CRLF + oException:Message
enddo
VOXSErrorHandler.ErrBox( cMessage )
	
return
	
static method WriteErrorLog( oException as Exception ) as void
local cFileName as string
local cErrorText as string
local oSB as StringBuilder

cFileName := Path.Combine( AppDomain.CurrentDomain:BaseDirectory, "XSharpError.log" )
oSB := StringBuilder{ String.Format( "Error occurred in {0} at {1}", Assembly.GetEntryAssembly():Location, DateTime.Now:ToString() ) }
oSB:AppendLine( "------------------------------------------------------------" )
oSB:AppendLine( oException:Message )
oSB:AppendLine( "Callstack:" )
oSB:AppendLine( oException:StackTrace )
oSB:AppendLine( "" )
File.AppendAllText( cFileName, oSB:ToString() )
	
return

HTH

Wolfgang

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #5 by Gianluca Pinoli
Replied by Gianluca Pinoli on topic bBrowser
Ciao Wolfgang,
this is whath i get from the debug:

#################################################################################################
Vulcan.VO.WCError

Callstack :
bTools.bBrowser.bBrowser.System.Void bTools.bBrowser.bBrowser..ctor(Vulcan.__Usual[] Xs$Args)() : C:\XIDE\Projects\bBrowser4\Applications\bBrowser\Controls\bBrowser (Control).prg : 382
BasicForm.System.Void BasicForm..ctor()() : C:\XIDE\Projects\TestBB4\Applications\FormApp1\Prg\Form1.prg : 20
static Int32 FormApp1.Exe.Functions.Start(System.String[] asCmdLine)() : C:\XIDE\Projects\TestBB4\Applications\FormApp1\Prg\Start.prg : 13
#################################################################################################


By the way.. How can I use your logging function? Does it need any external reference?

Thanks
Gianluca

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago - 10 months 5 days ago #6 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser
Ciao Gianluca,

no, my logging does not need any external references.

I have attached the entire prg zipped to this message.

I'm using it this way:
function Start() as int

#ifdef __XSHARP__
try
#else
begin sequence
ErrorBlock( {|oError| WDefError(oError)} )
#endif

oApp		:= EnhancedApp{}
__SetAppObject( oApp )
oApp:Start()

#ifdef __XSHARP__
catch oEx as Exception
	
VOXSErrorHandler.ProcessException( oEx )
	
end try
#else	
end sequence
#endif
	
oApp:Quit()
oApp:Destroy()
oApp 		:= NULL_OBJECT
	
return 0

As you can see, I can use the same code in VO and X#, and manage the differences using #ifdef statements.

Wolfgang

P.S. in a few minutes I will leave my PC until tomorrow morning, so please don't expect any answer from me.
Attachments:
Last edit: 10 months 5 days ago by Wolfgang Riedmann.

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #7 by Chris Pyrgas
Replied by Chris Pyrgas on topic bBrowser
Hi Gianluca,

The problem is because bBrowser is a VO GUI control but you are trying to put it in a Windows.Forms form. Theoretically it would be possible to do that, but it is not easy.

Normally you would put bBrowser in a VO-style window, for example create a new app in XIDE, select the "Standard VO MDI" template, this will create an app very similar to what you create in a similar way in VO. There you can create a new window (with Tools->VOWindow Editor) and put bBrowser in it like any other control. Also if you put your cavowed.inf and tpl files from your VO folder to \XIDE\Config\, then bBrowser should be visible in XIDE's toolbox, same as in VO.

But if you want to create a pure .Net app (no VO GUI), then it's more complicated. bBrowser is designed to work with VOGUI, so obvious answer is that you need one of the grid controls available for winforms or WPF in .Net. Although it would be an interesting exercise trying to make bBrowser work in winforms as well, but it will be a lot of work.

Btw, I am seeing you are getting dozens of "165" warnings, which are cluttering the compiling results. In the beginning, I would suggest to just disable reporting this specific warning, by using a /nowarn:165 in the compiler options (App properties/Compiler page, first edit on top). Or you can go to Tools/Preferences/compiler and enable "Always apply /nowarn:165".

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #8 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser
Hi Chris,

after looking at the SDK sources I suspected something like this.

Wolfgang

Please Log in or Create an account to join the conversation.

More
10 months 4 days ago #9 by Gianluca Pinoli
Replied by Gianluca Pinoli on topic bBrowser
Hi Chris,
i actually used Windows.Forms Form, testing bBroweser.
Thanks for your analysis of my problem.
I'll try again how you suggest

Regards
Gianluca

Please Log in or Create an account to join the conversation.

More
10 months 4 days ago #10 by Gianluca Pinoli
Replied by Gianluca Pinoli on topic bBrowser
Ciao Wolfganag,
thanks again for yous help.

Regards
Gianluca

Please Log in or Create an account to join the conversation.

More
10 months 4 days ago - 10 months 4 days ago #11 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser
Ciao Gianluca,

there should be a special class that permit to include a VO GUI window in a WinForms application, and also another class for the way around: to use WinForms windows in a VO GUI application.
Please look at the first two samples in this page:
http://www.govulcan.net/portal/Examples/MoreSamples/tabid/105/Default.aspx

I have tried (with Chris's help) another thing: include a WinForms control in a VO GUI windows (xported to X# of course), and this works like a charm.

Wolfgang
Last edit: 10 months 4 days ago by Wolfgang Riedmann.

Please Log in or Create an account to join the conversation.