|
-
Mar 10th, 2006, 05:46 AM
#1
Thread Starter
Fanatic Member
[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
"I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." - Paul Ryan, DailyRamblings
-
Mar 10th, 2006, 05:58 AM
#2
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)
-
Mar 10th, 2006, 06:06 AM
#3
Thread Starter
Fanatic Member
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
"I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." - Paul Ryan, DailyRamblings
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|