A
Andrew Mueller
Hello,
I have been searching for quite awhile and probably just do not know
what to search on....
Here is my issue:
I am creating a Windows Service and I referenced a dll. I have used
this dll many times with Visual Studio 6, but never 2003. I have no problem
instantiating the object. In fact, I can physically see the object's icon
in the system tray. However, I cannot seem to use the methods like I used
to be able to....
My logic is this:
Using MyDll;
namespace MyServiceName
{
public class MyService1 : System.ServiceProcess.ServiceBase
{
:
public MyService1()
{
InitializeComponent();
MyDll.MyDllClass MyObject = new MyDll.MyDllClass();
MyObject.SendMessage("Here is my message");
:
:
}
protected override void OnStart(string[] args);
{
MyObject.SendMessage("Here is my message");
}
}
}
Of course, there is a lot more code than this which makes it operable, but
this is the gist of what I have that doesn't work for me... In the
MyService1 constructor, I instantiate the object and I can see the
Intellisense working to grab the SendMessage method. However, that method
does not run within the constructor. I was unsure if it would or not, but
assume that this in not proper coding anyway even if it were to work. It
was a test.
In the OnStart routine, when I put the code there, it doesn't even compile.
With an error of:
'The type or namespace name 'MyObject' could not be found (are you
missing a using directive or an assembly reference?)"
I am assuming that I am missing an assembly reference, but I am unsure what
that is.... Please help me along with this. I am sure that it is simple and
I am missing some basics of C#...
Thanks in advance,
Andrew Mueller
I have been searching for quite awhile and probably just do not know
what to search on....
Here is my issue:
I am creating a Windows Service and I referenced a dll. I have used
this dll many times with Visual Studio 6, but never 2003. I have no problem
instantiating the object. In fact, I can physically see the object's icon
in the system tray. However, I cannot seem to use the methods like I used
to be able to....
My logic is this:
Using MyDll;
namespace MyServiceName
{
public class MyService1 : System.ServiceProcess.ServiceBase
{
:
public MyService1()
{
InitializeComponent();
MyDll.MyDllClass MyObject = new MyDll.MyDllClass();
MyObject.SendMessage("Here is my message");
:
:
}
protected override void OnStart(string[] args);
{
MyObject.SendMessage("Here is my message");
}
}
}
Of course, there is a lot more code than this which makes it operable, but
this is the gist of what I have that doesn't work for me... In the
MyService1 constructor, I instantiate the object and I can see the
Intellisense working to grab the SendMessage method. However, that method
does not run within the constructor. I was unsure if it would or not, but
assume that this in not proper coding anyway even if it were to work. It
was a test.
In the OnStart routine, when I put the code there, it doesn't even compile.
With an error of:
'The type or namespace name 'MyObject' could not be found (are you
missing a using directive or an assembly reference?)"
I am assuming that I am missing an assembly reference, but I am unsure what
that is.... Please help me along with this. I am sure that it is simple and
I am missing some basics of C#...
Thanks in advance,
Andrew Mueller