Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

bBrowser 16 Mar 2018 12:10 #4318

  • gianluca.pinoli
  • gianluca.pinoli's Avatar
  • Topic Author


  • Posts: 35
  • 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.

    bBrowser 16 Mar 2018 13:39 #4320

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3198
  • 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#):
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    bBrowser 16 Mar 2018 16:05 #4321

    • gianluca.pinoli
    • gianluca.pinoli's Avatar
    • Topic Author


  • Posts: 35
  • 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

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

    bBrowser 16 Mar 2018 16:21 #4322

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3198
  • 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
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    bBrowser 16 Mar 2018 16:50 #4323

    • gianluca.pinoli
    • gianluca.pinoli's Avatar
    • Topic Author


  • Posts: 35
  • 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.

    bBrowser 16 Mar 2018 16:58 #4324

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3198
  • 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.
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    Last edit: by wriedmann.

    bBrowser 16 Mar 2018 18:22 #4327

    • Chris
    • Chris's Avatar


  • Posts: 3667
  • 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.

    bBrowser 16 Mar 2018 18:56 #4328

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3198
  • Hi Chris,

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

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    bBrowser 17 Mar 2018 10:37 #4337

    • gianluca.pinoli
    • gianluca.pinoli's Avatar
    • Topic Author


  • Posts: 35
  • 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.

    bBrowser 17 Mar 2018 10:39 #4338

    • gianluca.pinoli
    • gianluca.pinoli's Avatar
    • Topic Author


  • Posts: 35
  • Ciao Wolfganag,
    thanks again for yous help.

    Regards
    Gianluca

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

    bBrowser 17 Mar 2018 12:11 #4339

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3198
  • 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:
    www.govulcan.net/portal/Examples/MoreSam...bid/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
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    Last edit: by wriedmann.
    • Page:
    • 1