Click here to Skip to main content
15,917,328 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows Service doesn't make event logs on Windows Server 2003 due to insufficient rights Pin
Rocky#16-Apr-09 3:19
Rocky#16-Apr-09 3:19 
GeneralRe: Windows Service doesn't make event logs on Windows Server 2003 due to insufficient rights Pin
Eddy Vluggen16-Apr-09 8:38
professionalEddy Vluggen16-Apr-09 8:38 
QuestionHow to cast multiple form in class Pin
RoalearK16-Apr-09 0:48
RoalearK16-Apr-09 0:48 
AnswerRe: How to cast multiple form in class Pin
0x3c016-Apr-09 0:55
0x3c016-Apr-09 0:55 
QuestionRe: How to cast multiple form in class Pin
RoalearK16-Apr-09 15:59
RoalearK16-Apr-09 15:59 
QuestionHow to print DataGridView using C#.Net in windows application Pin
pradeepc_mca16-Apr-09 0:01
pradeepc_mca16-Apr-09 0:01 
AnswerRe: How to print DataGridView using C#.Net in windows application Pin
Abhijit Jana16-Apr-09 0:21
professionalAbhijit Jana16-Apr-09 0:21 
QuestionHow to make a complex type visible to the client in .NET remoting and WCF? Pin
Farawin15-Apr-09 23:11
Farawin15-Apr-09 23:11 
I'm currently testing several ways to have one application get hold of an object from another application. Both are written in C# and wether I use IPC channels or WCF Service Contracts I end up with the same problem. If I use a simple class whose properties and methods only return the built in types (such as int, string or ArrayList) it works fine, but if I add another property of a custom made type I get an error. IPC gives me a InvalidCastException and WCF puts the channel in a Faulted state and it breaks. Obviously I'm doing something wrong and I hope someone can give me a hand. The server looks like this:

public interface IBase {

   int IntTest { get; }
   String StringTest { get; }
   IOther OtherTest { get; }

   String Test(String txt);
   IOther Test3();
}

public interface IOther {
   String StringTest { get; }
   String Test(String txt);
}

public class Base : MarshalByRefObject, IBase {

   public int IntTest {
     get { return 4; }
   }

   public string StringTest {
     get { return "A string from Base"; }
   }

   public IOther OtherTest {
     get { return new Other(); }
   }

   public string Test(string txt) {
     return "Base called with: " + txt;
   }

   public IOther Test3() {
     return new Other();
   }

}

public class Other : MarshalByRefObject, IOther {

   public string StringTest {
     get { return "A string from Other"; }
   }

   public string Test(string txt) {
     return "Other method called with: " + txt;
   }

}


The server is registered like this:
public MainWindow() {
   InitializeComponent();
   IpcChannel ipcCh = new IpcChannel("IPChannelName");
   ChannelServices.RegisterChannel(ipcCh, false);
  RemotingConfiguration.RegisterWellKnownServiceType(typeof(Base), "CName", WellKnownObjectMode.Singleton);
}


The client looks something like this:

IpcChannel ipcCh = new IpcChannel("myClient");
ChannelServices.RegisterChannel(ipcCh, false);
obj = (IBase)Activator.GetObject(typeof(IBase), "ipc://IPChannelName/CName");
Console.WriteLine("Returns: " + obj.Test("a text"));
Console.WriteLine("Returns: " + obj.StringTest + " " + obj.StringTest.Length);
Console.WriteLine("Returns: " + obj.IntTest);
Console.WriteLine(obj.OtherTest.ToString());


The last line gives me the InvalidCastException or, in the cae of WCF, the Faulted pipe. Please help.
AnswerRe: How to make a complex type visible to the client in .NET remoting and WCF? Pin
dojohansen16-Apr-09 0:54
dojohansen16-Apr-09 0:54 
GeneralRe: How to make a complex type visible to the client in .NET remoting and WCF? Pin
Farawin16-Apr-09 1:22
Farawin16-Apr-09 1:22 
GeneralRe: How to make a complex type visible to the client in .NET remoting and WCF? Pin
dojohansen16-Apr-09 3:42
dojohansen16-Apr-09 3:42 
GeneralRe: How to make a complex type visible to the client in .NET remoting and WCF? Pin
Farawin16-Apr-09 21:45
Farawin16-Apr-09 21:45 
NewsInteresting Article for C# and Navision Developers Pin
abhishek pareek200915-Apr-09 23:05
abhishek pareek200915-Apr-09 23:05 
QuestionHow do you implement the auto reload process from database data in windows form for display? Pin
calendarw15-Apr-09 22:26
calendarw15-Apr-09 22:26 
AnswerRe: How do you implement the auto reload process from database data in windows form for display? Pin
Mycroft Holmes15-Apr-09 23:20
professionalMycroft Holmes15-Apr-09 23:20 
GeneralRe: How do you implement the auto reload process from database data in windows form for display? Pin
calendarw15-Apr-09 23:41
calendarw15-Apr-09 23:41 
AnswerRe: How do you implement the auto reload process from database data in windows form for display? Pin
SeMartens15-Apr-09 23:21
SeMartens15-Apr-09 23:21 
GeneralRe: How do you implement the auto reload process from database data in windows form for display? Pin
calendarw15-Apr-09 23:47
calendarw15-Apr-09 23:47 
AnswerRe: How do you implement the auto reload process from database data in windows form for display? Pin
dojohansen16-Apr-09 1:15
dojohansen16-Apr-09 1:15 
QuestionDraw text along points Pin
baranils15-Apr-09 22:22
baranils15-Apr-09 22:22 
AnswerRe: Draw text along points Pin
Henry Minute15-Apr-09 23:26
Henry Minute15-Apr-09 23:26 
GeneralRe: Draw text along points Pin
baranils16-Apr-09 0:25
baranils16-Apr-09 0:25 
GeneralRe: Draw text along points [modified] Pin
Henry Minute16-Apr-09 0:41
Henry Minute16-Apr-09 0:41 
GeneralRe: Draw text along points Pin
baranils16-Apr-09 0:56
baranils16-Apr-09 0:56 
GeneralRe: Draw text along points Pin
Henry Minute16-Apr-09 0:57
Henry Minute16-Apr-09 0:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.