473,657 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remoting objects extending abstract class

I was trying to abstract some properties and methods for a group of
remoting objects, but it seems that during testing I am finding that
the remoting objects are generating null reference exceptions when I
try to access these properties and methods. Below is a sample of what
I was attempting to do.

public class ParentManager : MarshalObjByRef
{
private string enabled;

protected string Enabled
{
get { return this.enabled; }
set { this.enabled = value; }
}

protected void Initialize(stri ng value)
{
this.enabled = value;
}
}

public class SubManager : ParentManager
{
public SubManager()
{
this.Initialize ("TRUE");
}

public void Test()
{
if(this.enabled .Equals("TRUE") )
{
Console.WriteLi ne("SubManager is enabled.");
}
}
}

When I call test I get a Null reference exception because the
initialize function has not be executed.

Cheers!

Apr 9 '07 #1
1 1235
Hello sean,
>When I call test I get a Null reference exception because the
initialize function has not be executed.
Well, where does the object come from? Are you sure you're calling the
Test method on the same instance that you initialized before? This will
depend on your activation method and where that instance/reference comes
from.
Oliver Sturm
--
http://www.sturmnet.org/blog - MVP C#
Apr 10 '07 #2

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

Similar topics

49
2870
by: Steven Bethard | last post by:
I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another class). Any comments would be appreciated! Thanks! Steve ----------------------------------------------------------------------
1
1821
by: f00sion | last post by:
I found a good tutorial of how to supply the objects without having the implementation files on the client. This was working great until I realized that I couldnt use any constructors with server activated objects, so I switched to client activated objects only to run into the next roadblock, doh! can't instantiate abstract classes... here is a simple example of the structure, im sure there is a way to do it to allow instantiation but I am...
2
1220
by: Richard Lewis Haggard | last post by:
I know this is a really simple thing but it is not intuitively obvious on how to do this the first time. I've created a remote server which lives in an EXE. This compiles. I've create a client of the remote server which fails to compile due to a failure of the 'using' line that would import the server class's definition. I can't figure out how to add the server as a reference because the server is an EXE, not a DLL.
8
2694
by: Richard Bell | last post by:
I have a class in a seperate dll which I want to remote. I have referenced the class and registered it using a simple exe. I can connect to the class's interface using Activator.GetObject and call it's methods. However, when I use soapsuds to extract meta data, I get the following error: Error: Unable to retrieve schema from url: http://localhost:1234/RemoteObject.soap?WSDL, The remote server returned an error: (500) Internal Server...
4
3112
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give it a go). What I want to do is this: Have a server instance of the program, this server instance will receive communication from client programs (as demonstrated in the AddMessage()
0
953
by: Nadav | last post by:
Hi, Introduction: ******************** I am using remoting to expose the control channels of my streaming server, I need to be able to detect when a certain client was terminated, this should be done ONLY from the server side. My server expose the IServer interface what contain a single CreateSession method, calling this method returns ( through remoting ) a session interface
5
2934
by: needin4mation | last post by:
Hi, I read this in a book about the Xml classes in c#: "These classes are abstract and therefore must be extended." I just wanted to know what this statement means. I know it is not in context, but the author gave it in such a matter that it appears experience folks will know what it means to say a class is abstract and extended. Thanks.
3
1708
by: Lucas Tam | last post by:
Does anyone have a good articles that describes the pros and cons of Web Services vs. Remoting Hosted in IIS? Is there a reason to use either or? With Remoting Hosting in IIS, is it possible to maintain a constant thread (i.e. thread that polls the database and sends messages back to client when a certain record is found?). Thanks.
1
1986
by: hocker | last post by:
I have created a client-server application using .NET remoting in C#. The client initiates a call to the server then subscribes to events from the server, using an abstract class which contains the events. I am inheriting the remote class from MarshalByRefObject and am publishing a tcp based WellKnownServiceType as a singleton. It works fine - I call a method from the client and it executes on the server, and events are triggered from the...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
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...
0
7320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
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
5632
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.