Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global memvar declared (and assigned a value) in one module, not visible in another module - ?

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
571
US
Colleagues,
What's described in the Subject line is very strange! Especially considering that it always worked before!
Let's say, you have a main module (e.g. Form), in which you have something like

Code:
Public Class Form1
Public gcSMTPClient As String, giSMTPPort As Integer

You, programmatically, obtain and assign this SMTP Client and SMTP Port values (in my case - from INI file).
Then, in another module, you have a code like this:

Code:
Dim loMailClient As New SmtpClient(gcSMTPClient, giSMTPPort)

and it should work, right?
It did, when it was in WinForms app type.
I have another (WinForms) program that starts with Main, and all the global memvars declared there are visible for another dozen modules in that project.

But in the Service type app it errs: "'[highlight #FCE94F]gsSMTPClient' is not declared[/highlight]" - ?!
Same with the all Global memvars declared (and assigned!) in that other module...

And the Q. is: is it pertinent to the Service type apps that one module can't "see" a global (Public) memvar declared in another module?

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top