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
|