fbpx
× Share your code snippets, screen shots etc. here

bBrowser.NET migration to X#

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
1 year 2 months ago #1 by Wolfgang Riedmann
bBrowser.NET migration to X# was created by Wolfgang Riedmann
Hi,

until a bBrowser.NET version is released specifically for X#, I would like to post a migration guide for people that cannot wait.

Please see it attached to this message.

Wolfgang
Attachments:

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

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
1 year 2 months ago #2 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser.NET migration to X#
Hi all,

I'm now a step further: I have converted the 3 vh files you normally need to include in a .NET application using bBrowser.NET to a library, basically changing all statements like
#define ASC_DOT 0x2E
to
define ASC_DOT := 0x2E
If anyone needs it until bBrowser.NET is released for X#, you will find it attached to this message.
Wolfgang
Attachments:

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

More
7 months 1 week ago #3 by Niels Kristensen
Replied by Niels Kristensen on topic bBrowser.NET migration to X#
Wolfgang (or anyone else),

Thank you very much for this. I am a real newbie with his .NET stuff. I was a VPOS member, bought bBrowser.Net, etc but never got any of it to work in real work applications. Now I am trying XS and I am sure I will come right eventually!

I followed your bBrowser migration guidelines and am getting errors XS0246: The type or namespace name 'DBServer' could not be found (are you missing a using directive or an assembly reference?)

I have added references to VulcanVORDDClasses, etc but error won't go away.

Any help would be appreciated.

regards,
Niels

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

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
7 months 1 week ago #4 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser.NET migration to X#
Hi Niels,

the DBServer class is defined in the VulcanVORDDClasses.DLL, but the DataServer (from which the DBServer is inherited) is in the VulcanVOSystemClasses.DLL, so you need to include this library as well.

Wolfgang

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

More
7 months 1 week ago - 7 months 1 week ago #5 by Johan Nel
Replied by Johan Nel on topic bBrowser.NET migration to X#
Hi Niels,

nkristensen wrote: I have added references to VulcanVORDDClasses, etc but error won't go away.

Did you also inlclude a USING statement in the top of your PRG? Otherwise you need to maybe provide the full namespace of the DbServer class. Might be good to show some code to get you on track.
Regards,

______________________
Johan Nel
George, South Africa
Last edit: 7 months 1 week ago by Johan Nel. Reason: Added namespace response

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

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
7 months 1 week ago - 7 months 1 week ago #6 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser.NET migration to X#
Hi Johan,

a using statement should not be needed as all of the VO classes are using the namespace Vulcan.VO. (of course the compiler option /ins "Use implicit namespace" needs to be used.)

The question is now if the error shows up in the bBrowser compilation process or in an application that uses the bBrowser libraries.
For the first one, the following libraries are needed:
mscorlib.dll
SDK_Defines.dll
VulcanRT.dll
VulcanRTFuncs.dll
VulcanVOGuiClasses.dll
VulcanVORDDClasses.dll
VulcanVOSystemClasses.dll
VulcanVOWin32ApiLibrary.dll

Wolfgang
Last edit: 7 months 1 week ago by Wolfgang Riedmann.

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

More
7 months 1 week ago #7 by Niels Kristensen
Replied by Niels Kristensen on topic bBrowser.NET migration to X#
Thanks Wolfgang / Johan,

This is what I have at the top of the one .prg
#include "VORDDClasses.vh"
#include "VOSystemClasses.vh"
#include "VOSystemLibrary.vh"
//#include "bServer.vh"     

BEGIN NAMESPACE bTools.bServer

   CLASS bDBServer INHERIT DBServer

I have added references to both VulcanVORDDClasses and VulcanVOSystemClasses

I also tried the /ins compiler option, hut hat then gives a lot of other errors:
error XS9041: Override of virtual method 'Close' has STRICT calling convention but overridden method in parent class is CLIPPER. 1139,7 bArrayServer (Server).prg bServer


Regards,
Niels

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

More
7 months 1 week ago #8 by Johan Nel
Replied by Johan Nel on topic bBrowser.NET migration to X#
Hi Wolfgang,

wriedmann wrote: a using statement should not be needed as all of the VO classes are using the namespace Vulcan.VO. (of course the compiler option /ins "Use implicit namespace" needs to be used.)
The question is now if the error shows up in the bBrowser compilation process or in an application that uses the bBrowser libraries.

I agree, was also my thoughts. Think Niels should show us the complete error message and maybe the code snippet that produces the error. Without seeing the context it could be created in a couple of places.
Regards,

______________________
Johan Nel
George, South Africa

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

More
7 months 1 week ago #9 by Niels Kristensen
Replied by Niels Kristensen on topic bBrowser.NET migration to X#
I have added all those references. I am compiling the bServer application of bBrowser, and get the following errors:
error XS0246: The type or namespace name 'DataServer' could not be found (are you missing a using directive or an assembly reference?)

for both DBServer and DataServer. If I use the /ins compiler option, then I get the other errors in my previous post. No other compiler options are selected.

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

More
7 months 1 week ago #10 by Johan Nel
Replied by Johan Nel on topic bBrowser.NET migration to X#

nkristensen wrote: This is what I have at the top of the one .prg

#include "VORDDClasses.vh"
#include "VOSystemClasses.vh"
#include "VOSystemLibrary.vh"
//#include "bServer.vh"

Just to clarify, by adding reference do you mean the #include statements or a reference in you project to the VORDDClasses.dll assembly? You need a reference to the assembly in your project, not just a #include.
Regards,

______________________
Johan Nel
George, South Africa

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

More
7 months 1 week ago #11 by Niels Kristensen
Replied by Niels Kristensen on topic bBrowser.NET migration to X#
Hi Johan,

Yes, references in the project to the assemblies from GAC. '

Regards,
Niels

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

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
7 months 1 week ago - 7 months 1 week ago #12 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser.NET migration to X#
hi Niels,

strange..... I'm using XIDE to compile, and I have not done anything strange.





Do you are usings Visual Studio or XIDE?

Wolfgang

P.S. I'm using self compiled versions of the VO class libraries, therefore the "strange" name
Attachments:
Last edit: 7 months 1 week ago by Wolfgang Riedmann.

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

More
7 months 1 week ago #13 by Niels Kristensen
Replied by Niels Kristensen on topic bBrowser.NET migration to X#
Thanks Wolfgang,

I am also using XIDE, but I have no complier options set. I will try your settings.

Regards,
Niels

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

More
7 months 1 week ago #14 by Niels Kristensen
Replied by Niels Kristensen on topic bBrowser.NET migration to X#
Wolfgang,

Working now using the same compiler options as you.

Thank you very much to you and Johan.

Regards,
Niels

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

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
7 months 1 week ago - 7 months 1 week ago #15 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser.NET migration to X#
Hi Niels,

You're welcome!

If you find other difficulties, please drop a note here. I'll try to answer and to add it also to the X# Documentation Project,

Wolfgang
Last edit: 7 months 1 week ago by Wolfgang Riedmann.

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

More
7 months 1 week ago #16 by Johan Nel
Replied by Johan Nel on topic bBrowser.NET migration to X#
Hi Niels,

nkristensen wrote: Thank you very much to you and Johan.

You welcome, but the honor goes to Wolfgang. Glad you got it sorted out.
Regards,

______________________
Johan Nel
George, South Africa

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

More
7 months 1 week ago #17 by Niels Kristensen
Replied by Niels Kristensen on topic bBrowser.NET migration to X#
Sorry to trouble again, but now I am getting:

error XS0426: The type name 'Functions' does not exist in the type 'bBrowser' 6,46 bptrCellGroupMove.prg bBrowser

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

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
7 months 1 week ago #18 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic bBrowser.NET migration to X#
Hi Niels,

strange....do you have applied the same compiler options also to the bBrowser library?

Wolfgang

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

More
7 months 1 week ago #19 by Chris Pyrgas
Replied by Chris Pyrgas on topic bBrowser.NET migration to X#
Guys, glad you have all resolved this, without help from us! In general, when you port code from vulcan to X#, you should be using the exact same compiler options in X# that also the vulcan app was using, we have intentionally used the exact same names in the properties pages of VS/XIDE, in order to make this as easy as possible.

Specifically about the "Clipper/Strict" error, the issue is that when you have a method defined as

METHOD Close() // no params or explicit return type

then the compiler does not know if it should be defined as a strongly typed method, or it is a VO-style calling convention method. Using the /vo5 (implicit CLIPPER calling convention) option, tells the compiler to treat such methods as CLIPPER, which is what the rest of the bBrowser code uses.

Chris

XSharp Development Team
chris(at)xsharp.eu

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

More
7 months 1 week ago #20 by Chris Pyrgas
Replied by Chris Pyrgas on topic bBrowser.NET migration to X#
Hi Niels,

nkristensen wrote: Sorry to trouble again, but now I am getting:

error XS0426: The type name 'Functions' does not exist in the type 'bBrowser' 6,46 bptrCellGroupMove.prg bBrowser


This is most probably due to a (one of the very few remaining) compiler problem, that you cannot have a class with the same name as the dll. Please check the options for this app, general page, what is the "Assembly Name" option set at? If it's bBrowser, then it will not work correctly, you will need to change it to something different, for example "bBrowserNet". I think the original value there as created by Joachim was "bTools.bBrowser".

Chris

XSharp Development Team
chris(at)xsharp.eu

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