VB .NET and default instances

View: New views
5 Messages — Rating Filter:   Alert me  

VB .NET and default instances

by Styma, Robert E (Robert)-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
   I have inherited a VB.net application.  The application
is currently developed under Visual Studio 2008 and is
a GUI using a bunch of Windows Forms.  I would
like to be able to run this under Linux and it appears I
need Mono to do this.  In the documentation, I noticed
the documentation mention that the "Default Instance"
is not supported.  This application happens to use this
feature in several places.

   The way I have seen this done in Java is to have a
"getInstance() method which accesses a static copy of the
object and creates it the first time getInstance() is called.
Would this be a workable mechanism to get the program
to run under Mono?  It would be a pretty easy change to make.

   The documentation seems to say that I can run the .exe
created by Visual Studio with the Mono Runtime if I can get
the libraries correct.  I have not been able to do this yet,
but I am thinking I need to clean up the default instance issue
first.  Is this the case?

Bob Styma
Phoenix, Az, USA
_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: VB .NET and default instances

by Chris Howie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 30, 2009 at 9:46 AM, Styma, Robert E (Robert)
<robert.styma@...> wrote:
> Hi,
>   I have inherited a VB.net application.  The application
> is currently developed under Visual Studio 2008 and is
> a GUI using a bunch of Windows Forms.  I would
> like to be able to run this under Linux and it appears I
> need Mono to do this.  In the documentation, I noticed
> the documentation mention that the "Default Instance"
> is not supported.  This application happens to use this
> feature in several places.

What documentation are you referring to?  I am unaware of any .NET or
C# feature called "default instance."

>   The way I have seen this done in Java is to have a
> "getInstance() method which accesses a static copy of the
> object and creates it the first time getInstance() is called.
> Would this be a workable mechanism to get the program
> to run under Mono?  It would be a pretty easy change to make.

Yes, this is the singleton pattern.  It has worked with Mono for as
long as I have used Mono.

>   The documentation seems to say that I can run the .exe
> created by Visual Studio with the Mono Runtime if I can get
> the libraries correct.  I have not been able to do this yet,
> but I am thinking I need to clean up the default instance issue
> first.  Is this the case?

It's hard to say whether or not that's the case without seeing some
sort of diagnostic output from Mono.  You might look at running your
app through MoMA <http://mono-project.com/MoMA> to see if it's doing
anything blatantly non-portable.
<http://www.mono-project.com/Guidelines:Application_Portability> is
also a good read in this regard.

--
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: VB .NET and default instances

by Styma, Robert E (Robert)-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 

> Subject: Re: [Mono-list] VB .NET and default instances
>
> On Fri, Oct 30, 2009 at 9:46 AM, Styma, Robert E (Robert)
> <robert.styma@...> wrote:
> > Hi,
> >   I have inherited a VB.net application.  The application
> > is currently developed under Visual Studio 2008 and is
> > a GUI using a bunch of Windows Forms.  I would
> > like to be able to run this under Linux and it appears I
> > need Mono to do this.  In the documentation, I noticed
> > the documentation mention that the "Default Instance"
> > is not supported.  This application happens to use this
> > feature in several places.
>
> What documentation are you referring to?  I am unaware of any .NET or
> C# feature called "default instance."

I don't exactly remember where I saw the reference.  In VB .Net, I can
refer to a class name as an object and access non-Shared (static)
methods.  The term "Default Instance" was used to refer to an
instance of the object which is created to allow this.  This technique
makes me uncomfortable even though it is probably implemented under
the covers as a singleton.  Since the main Windows Form is created
by the runtime, that is how I have to access public methods data items
in the main form, so I can't get rid of this completely.

>
> >   The way I have seen this done in Java is to have a
> > "getInstance() method which accesses a static copy of the
> > object and creates it the first time getInstance() is called.
> > Would this be a workable mechanism to get the program
> > to run under Mono?  It would be a pretty easy change to make.
>
> Yes, this is the singleton pattern.  It has worked with Mono for as
> long as I have used Mono.

Good.  Thank you.

>
> >   The documentation seems to say that I can run the .exe
> > created by Visual Studio with the Mono Runtime if I can get
> > the libraries correct.  I have not been able to do this yet,
> > but I am thinking I need to clean up the default instance issue
> > first.  Is this the case?
>
> It's hard to say whether or not that's the case without seeing some
> sort of diagnostic output from Mono.  You might look at running your
> app through MoMA <http://mono-project.com/MoMA> to see if it's doing
> anything blatantly non-portable.
> <http://www.mono-project.com/Guidelines:Application_Portability> is
> also a good read in this regard.

The previous responder pointed me a MoMa, and that has made a bunch
of things clear.  The calls to build Excel Spread Sheets (CreateObject)
and a bunch of the things called in the printer compatibility library
pretty much stop me for a while.  My primary purpose in this exercise
was to lure some of the users from the "Dark Side" to Linux.

Thank you for the infomation
>
> --
> Chris Howie
> http://www.chrishowie.com
> http://en.wikipedia.org/wiki/User:Crazycomputers
>
_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: VB .NET and default instances

by Rolf Bjarne Kvinge-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

>
> Hi,
>    I have inherited a VB.net application.  The application
> is currently developed under Visual Studio 2008 and is
> a GUI using a bunch of Windows Forms.  I would
> like to be able to run this under Linux and it appears I
> need Mono to do this.  In the documentation, I noticed
> the documentation mention that the "Default Instance"
> is not supported.  This application happens to use this
> feature in several places.

Default Instances was implemented some time ago, where did you read this so
that I can update the documentation?

>    The way I have seen this done in Java is to have a
> "getInstance() method which accesses a static copy of the
> object and creates it the first time getInstance() is called.
> Would this be a workable mechanism to get the program
> to run under Mono?  It would be a pretty easy change to make.
>
>    The documentation seems to say that I can run the .exe
> created by Visual Studio with the Mono Runtime if I can get
> the libraries correct.  I have not been able to do this yet,
> but I am thinking I need to clean up the default instance issue
> first.  Is this the case?

No, default instances needs to be supported by the vb compiler, you should
still be able to run the application with the Mono Runtime. Can you explain
exactly what you've done and what happens?

Rolf

>
> Bob Styma
> Phoenix, Az, USA
> _______________________________________________
> Mono-list maillist  -  Mono-list@...
> http://lists.ximian.com/mailman/listinfo/mono-list

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list

Re: VB .NET and default instances

by Styma, Robert E (Robert)-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 

> Hi,
>
> >
> > Hi,
> >    I have inherited a VB.net application.  The application
> > is currently developed under Visual Studio 2008 and is
> > a GUI using a bunch of Windows Forms.  I would
> > like to be able to run this under Linux and it appears I
> > need Mono to do this.  In the documentation, I noticed
> > the documentation mention that the "Default Instance"
> > is not supported.  This application happens to use this
> > feature in several places.
>
> Default Instances was implemented some time ago, where did
> you read this so
> that I can update the documentation?
>
> >    The way I have seen this done in Java is to have a
> > "getInstance() method which accesses a static copy of the
> > object and creates it the first time getInstance() is called.
> > Would this be a workable mechanism to get the program
> > to run under Mono?  It would be a pretty easy change to make.
> >
> >    The documentation seems to say that I can run the .exe
> > created by Visual Studio with the Mono Runtime if I can get
> > the libraries correct.  I have not been able to do this yet,
> > but I am thinking I need to clean up the default instance issue
> > first.  Is this the case?
>
> No, default instances needs to be supported by the vb
> compiler, you should
> still be able to run the application with the Mono Runtime.
> Can you explain
> exactly what you've done and what happens?
>
> Rolf
>
> >
> > Bob Styma
> > Phoenix, Az, USA

Hi Rolf,
  Thank you for your response.  I unfortunatly cannot be much help
on the documentation case.  I read this some time ago and it may have
been fixed.  I started playing with Mono be following the bread crumbs
after trying to run under wine.  I have been looking at this now and
then for the past year or so.  Each time brings me closer, but
it never quite runs.

   One of the previous responders pointed me to MoMa, which I found to
be a rather elegant tool.  It identified a number of calls which are not
supported.  Many of them are in the printer compatibility library
(Microsoft.VisualBasic.PowerPacks.Printing.Printer.dll) which
this application uses.  Some of the calls (like CreateObject) which
is used to invoke Excel, will probably not get implemented any time soon.

   This program draws lots of intricate forms, so I am loathe to rewrite
all that code to use the native .Net drawing.  

   Thank you again for your response, this port will just have to
wait for another day.

Bob Styma
_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list