473,796 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP ASAP....Windows Service Errors....passi ng information from .cs file to another .cs file in same namespace

Sorry to be such a novice about this but..... I have a windows service. It
contains two separate files. Both have the same namespace name.

I need to pass "bDisplay" into the other file. I am getting several errors
and not sure why or how to solve them does anyone have any help?

How do I access the other file?

ServerSocket.cs *This is where the main server start is so the" private bool
m_bIsDisplayed = false;" had to go here so it didn't reset every time.

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Diagnost ics;
using System.ServiceP rocess;
using System.Text;
using System.Runtime. InteropServices ;
using System.Net.Sock ets;
using System.IO;
using System.Net;
using Listener;
using System.Threadin g;

namespace Listener
{
private bool m_bIsDisplayed = false;

public bool GetIsDisplayed( )
{
return m_bIsDisplayed( );
}

public void SetIsDisplayed( bool bDisplay)
{
m_bIsDisplayed = bDisplay;
}

}

SocketListner.c s

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Diagnost ics;
using System.ServiceP rocess;
using System.Runtime. InteropServices ;
using System.Net.Sock ets;
using System.Threadin g;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.XPat h;
using System.Web;
using System.Windows. Forms;

using Listener;

namespace Listener
{

private void MsgBxDisplayed( Byte [] byteBuffer, int size)
{
string sData = Encoding.ASCII. GetString(byteB uffer,0, size);

try
{
if (m_bIsDisplayed == true)
///Need pass variable here of TRUE or FALSE so it doesn't
continue with the default everytime.
{

System.Diagnost ics.EventLog.Wr iteEntry(this.T oString(),sData );

}
else if (m_bIsDisplayed == false)
{

m_bIsDisplayed = true;

System.Diagnost ics.EventLog.Wr iteEntry(this.T oString(),sData );

DialogResult result = MessageBox.Show ("Failure", "WARNING!!" ,
MessageBoxButto ns.OK,
MessageBoxIcon. Error,
MessageBoxDefau ltButton.Button 1,
MessageBoxOptio ns.ServiceNotif ication);

if(result == DialogResult.OK )
{
// Closes the parent form.
//this.Close();
m_bIsDisplayed = false;
}

}

}
catch (Exception e)
{
System.Diagnost ics.EventLog.Wr iteEntry(this.T oString(),
"invalid IsDisplayed" + e.Message);
}
}

errors:

error CS0118: 'Listener.Serve rSocket.m_bIsDi splayed' denotes a 'field' where
a 'method' was expected
error CS0103: The name 'm_bIsDisplayed ' does not exist in the class or
namespace 'Listener.Socke tListener'
error CS0103: The name 'm_bIsDisplayed ' does not exist in the class or
namespace 'Listener.Socke tListener'
error CS0103: The name 'm_bIsDisplayed ' does not exist in the class or
namespace 'Listener.Socke tListener'
error CS0103: The name 'm_bIsDisplayed ' does not exist in the class or
namespace 'Listener.Socke tListener'
error CS0103: The name 'm_bIsDisplayed ' does not exist in the class or
namespace 'Listener.Socke tListener'

Nov 16 '05 #1
0 1303

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5483
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
10
2727
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through VS, however, when I change to release and put it out on the web it fails giving me the following error message The underlying connection was closed. Could not establish a trust relationship with the remote server.
6
2182
by: Nathan Kovac | last post by:
Yesterday afternoon I was getting the following errors in a windows service: 'DatabaseManager.DataComponent', 'Error', '3 Errors: Line: 0 - Metadata file 'ScriptingMethods.dll' could not be found Line: 0 - Metadata file 'RemoteLoader.dll' could not be found Line: 0 - Metadata file 'wwScripting.dll' could not be found' Service ran all night fine. This morning I reconnected to the process and the errors are no longer there. Only thing...
1
1365
by: Rob Meade | last post by:
Hi all, I found an article on how to write a Windows service here: http://www.dotnetbips.com/displayarticle.aspx?id=178 It was pretty much what I wanted, I want the service to scan a directory and do something based on a change - in my case I will want to point it to the inetpub/mailbox directory and look for new emails but that aside the process seemed the same.
6
5000
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
15
2584
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to determine who needs to receive the text message then send the message to the address. Only problem is, the employee may receive up to 4 of the same messages because each thread gets the recors then sends the message. I need somehow to prevent...
0
5577
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
3192
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works fine. Now we decided to move from mainframe IMS-DB2 to Windows 2003 server-DB2 UDB for LUW 9.5.
5
3311
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.