Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2004, 12:20 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sharing arrays between two VB.NET applications

(all VB.NET)
I have a VB Class Libray (DLL) and a VB COM DLL in the same solution (only those two projects, plus a Setup project). Each one has its forms.

I am trying to make them share one array of strings. I would like to be able to change this array from either/both DLLs when both are running at
the same time.

1) Is this possible?
2) how do I do it?

Currently I am importing the array from the first into the second DLL by exposing a subroutine using Public Interface and passing the array byValue.

Second question for the same configuration, can I call routines from the first DLL in the second and from the second DLL routines in the first? If I try to reference them in each other's references, .NET complains about Circular Referencing.

Thank you very much for your assistance
Kiza

 
Old December 16th, 2004, 08:33 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Default

For sharing an array, what I think would work would be the following:

1) Create a new class, called something like 'Variables'
2) Declare the array here, using Public Shared MyArray() As Object (or whatever)
3) Just refer to Variables.MyArray whenever you use the array. Obviously, you'll have to put a project level 'imports' statement in the project that doesn't contain the Variables class.

As for your second problem, it can't be done. In this case, this is a flag to the fact that the two dlls should actually be one.

Quote:
quote:Originally posted by Kiza
 (all VB.NET)
I have a VB Class Libray (DLL) and a VB COM DLL in the same solution (only those two projects, plus a Setup project). Each one has its forms.

I am trying to make them share one array of strings. I would like to be able to change this array from either/both DLLs when both are running at
the same time.

1) Is this possible?
2) how do I do it?

Currently I am importing the array from the first into the second DLL by exposing a subroutine using Public Interface and passing the array byValue.

Second question for the same configuration, can I call routines from the first DLL in the second and from the second DLL routines in the first? If I try to reference them in each other's references, .NET complains about Circular Referencing.

Thank you very much for your assistance
Kiza






Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop sharing in .NET pamurugesan .NET Framework 2.0 0 May 29th, 2008 01:56 AM
Sharing session values from an asp.net page? binici ASP.NET 2.0 Basics 4 January 8th, 2007 10:58 AM
sharing cookies between asp and vb.net collie Pro VB.NET 2002/2003 3 April 19th, 2005 10:31 AM
Applications in PDA with asp and vb rdigala Oracle 1 November 21st, 2003 09:08 AM
Using VB.NET to develop PDA applications aadz5 VB.NET 2002/2003 Basics 0 November 14th, 2003 08:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.