[RESOLVED] Sharing variable between exe and dll projects
Guys,
I have a main winform /exe project that has a string variable set as public on the main form. I then have a dll project that needs to see that string variable. How do I declare this so my .dll can see it ?
VB Code:
Public Class C1SpellCheck
Dim C1Spell As C1.Win.C1Spell.C1Spell
Public Sub New()
C1Spell = New C1.Win.C1Spell.C1Spell
Dim CDFile As String
CDFile = 'GlobalVar here
Re: Sharing variable between exe and dll projects
Can't you modify the DLL function to accept a passed in string variable in the new sub?
ex...
Public Sub New(ByVal MyString as String)
MyString would then be the global variable you refer to when declaring a new instance of the class, like below...
Dim MyCheck as new C1SpellCheck(MyString)
Re: Sharing variable between exe and dll projects
Yes mate, I'd just figured that out myself. DUH.
Public Sub New(ByVal CDFile As String)
C1Spell = New C1.Win.C1Spell.C1Spell
Thanks for the response.
Bob