Class Help

N

Neil Stevens

Hi,

I have been tasked to upgrade a project from VB6 to VB.NET, i have a number
of problems of which most i have now solved but i am still very perplexed by
one problem. The VB6 application has one class whose instance property is
declared as GlobalMultiUse and this class defines properties that are shared
between a number of other applications in use that will soon be converted to
..NET.

The problem is that during initial testing the new class in .NET declared as
Public with a Publi Sub New does not share across other applications.

Example:

ApplicationA (references DLLA which contains the public class)

when ApplicationA runs it sets up some of the properties in DLLA,
gConnection is one of the properties, which is held in a public module.

ApplicationB when it runs "should" return the already set connection string,
however this does not happen.

The corresponding effect is possible and indeed is in use in VB6, my
question is, how can you implement the same functionality in .NET now that
Microsoft (in thier infinite wisdom) has removed the GlobalMultiUse property
of class instancing, has anyone else come across this problem before, and
does anyone know of a workaround.

The end result is that DLLA should behave in the same way as it does in VB6
(as a server for global properties and methods which are shared between
applications), if this is not possible then .NET may not be suitable for the
needs of our client.

Thanks for any help in advance
Neil
 
A

Armin Zingler

Neil Stevens said:
ApplicationA (references DLLA which contains the public class)

when ApplicationA runs it sets up some of the properties in DLLA,
gConnection is one of the properties, which is held in a public
module.

ApplicationB when it runs "should" return the already set connection
string, however this does not happen.

Data is not shared among processes. Have a look at "Remoting":
http://msdn.microsoft.com/library/e...inotherapplicationdomainsusingnetremoting.asp


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
N

Neil Stevens

I think my example wasnt explained properly, in VB6 i have a globalmultiuse
class in a dll called utilities, and there are three applications that use
this dll.

When the main application is run it sets itself up and sets global
properties in the utilities class, if i now run one of the second
applications then it will have the same properties as the main application.

i.e. the connection string in the second application will already have been
set by the main application and thus the second application will just use
this connection string.

the class uses a module to hold the variables for the class, this behaviour
is what i need to implement in vb.net

Thanks
Neil
 
A

Armin Zingler

Neil Stevens said:
http://msdn.microsoft.com/library/e...inotherapplicationdomainsusingnetremoting.asp
I think my example wasnt explained properly, in VB6 i have a
globalmultiuse class in a dll called utilities, and there are three
applications that use this dll.

When the main application is run it sets itself up and sets global
properties in the utilities class, if i now run one of the second
applications then it will have the same properties as the main
application.

i.e. the connection string in the second application will already
have been set by the main application and thus the second application
will just use this connection string.

the class uses a module to hold the variables for the class, this
behaviour is what i need to implement in vb.net

Yes, that's what I understood. If you use the same library in two different
applications, you've got two different sets of data.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top