Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
QuestionHow to slide a panel without flickering Pin
SJ_Phoenix4-Mar-06 7:48
SJ_Phoenix4-Mar-06 7:48 
AnswerRe: How to slide a panel without flickering Pin
AFSEKI4-Mar-06 9:36
AFSEKI4-Mar-06 9:36 
GeneralRe: How to slide a panel without flickering Pin
SJ_Phoenix4-Mar-06 10:09
SJ_Phoenix4-Mar-06 10:09 
GeneralRe: How to slide a panel without flickering Pin
Thomas Stockwell4-Mar-06 17:25
professionalThomas Stockwell4-Mar-06 17:25 
AnswerRe: How to slide a panel without flickering Pin
AFSEKI5-Mar-06 4:44
AFSEKI5-Mar-06 4:44 
GeneralRe: How to slide a panel without flickering Pin
AFSEKI5-Mar-06 4:47
AFSEKI5-Mar-06 4:47 
GeneralRe: How to slide a panel without flickering Pin
SJ_Phoenix5-Mar-06 10:36
SJ_Phoenix5-Mar-06 10:36 
QuestionClient-Activated Object Pin
Marcin-Dz4-Mar-06 5:37
Marcin-Dz4-Mar-06 5:37 
I created service and client application. I had no problems with Server-activated Objects but in my case SAO is not what I need, becouse object must keep state for each client individually.

But when I use CAO I get error: object does not have constructor.

I tried to share only Interface betwean server and client and then full object definition, but I still get the same exception.


Piece of server code:
<br />
namespace ServerService<br />
{<br />
    public partial class Service1 : ServiceBase<br />
    {<br />
        //private TcpChannel m_TcpChan;<br />
<br />
        public Service1()<br />
        {<br />
            InitializeComponent();<br />
        }<br />
<br />
        protected override void OnStart(string[] args)<br />
        {<br />
            // TODO: Add code here to start your service.<br />
            //TcpChannel m_TcpChan = new TcpChannel(9999);<br />
            //ChannelServices.RegisterChannel(m_TcpChan);<br />
<br />
            ChannelServices.RegisterChannel(new HttpChannel(9999));<br />
            RemotingConfiguration.ApplicationName = "tester";<br />
            RemotingConfiguration.RegisterActivatedServiceType(typeof(MyRemoteClass));<br />
<br />
        }<br />
<br />
        protected override void OnStop()<br />
        {<br />
            // TODO: Add code here to perform any tear-down necessary to stop your service.<br />
        }<br />
    }<br />
<br />
    public class MyRemoteClass : MarshalByRefObject, MyInterface<br />
    {<br />
        public bool wywolany = false;<br />
<br />
        public int FunctionOne(string str)<br />
        {<br />
            if (wywolany) return str.Length + 1;<br />
            else<br />
            {<br />
                wywolany = true;<br />
                return str.Length;<br />
            }<br />
        }<br />
    }<br />
}<br />


Client code:
<br />
namespace Client<br />
{<br />
    class Program<br />
    {<br />
        public static MyInterface m_RemoteObject = null;<br />
        public static ObjectHandle oh = null;<br />
<br />
        static void Main(string[] args)<br />
        {<br />
            object[] url = { new UrlAttribute("http://localhost:9999/tester") };<br />
<br />
           <br />
            try<br />
            {<br />
<br />
                m_RemoteObject = (MyInterface)Activator.CreateInstance(typeof(MyInterface), url, null);<br />
              <br />
            }<br />
            catch(Exception e)<br />
            {<br />
                Console.WriteLine("Error konstruowania");<br />
                Console.WriteLine(e.Message);<br />
                Console.ReadLine();<br />
                return;<br />
            }<br />
<br />
            if(m_RemoteObject==null)<br />
            {<br />
                Console.WriteLine("Error wykonania");<br />
            }<br />
            else{<br />
                try<br />
                {<br />
                    Console.WriteLine(m_RemoteObject.FunctionOne("Nish"));<br />
                    Console.WriteLine(m_RemoteObject.FunctionOne("Nish"));<br />
                }<br />
                catch<br />
                {<br />
                    Console.WriteLine("Error");<br />
                    Console.ReadLine();<br />
                    return;<br />
                }<br />
            }<br />
            Console.ReadLine();<br />
        }<br />
    }<br />
}<br />



I have read many tutorials about CAO but I still have problems with it...

Please help
source code of the project (if it's necessary) can be downloaded from http://www.mdz.jawnet.pl/CAO.zip


Secound question:
In one article there was a method to get CAO using singlecall SAO - singlecalll method return reference to the object we want to host - is it a good idea?
Questionhow to turn off system error when i add daplicated ID unique? Pin
superdragon3-Mar-06 23:54
superdragon3-Mar-06 23:54 
AnswerRe: how to turn off system error when i add daplicated ID unique? Pin
Thomas Stockwell4-Mar-06 17:29
professionalThomas Stockwell4-Mar-06 17:29 
QuestionHow to pass the parameters for a dll functiion that is imported in dotnet environment. Pin
varmag3-Mar-06 22:31
varmag3-Mar-06 22:31 
AnswerRe: How to pass the parameters for a dll functiion that is imported in dotnet environment. Pin
AFSEKI5-Mar-06 4:52
AFSEKI5-Mar-06 4:52 
QuestionProcess id=0x748 (1864), Thread id = ... error! Pin
eyej3-Mar-06 14:58
eyej3-Mar-06 14:58 
GeneralRe: Process id=0x748 (1864), Thread id = ... error! Pin
Guffa3-Mar-06 21:39
Guffa3-Mar-06 21:39 
AnswerRe: Process id=0x748 (1864), Thread id = ... error! Pin
mav.northwind3-Mar-06 22:16
mav.northwind3-Mar-06 22:16 
GeneralRe: Process id=0x748 (1864), Thread id = ... error! Pin
eyej4-Mar-06 3:58
eyej4-Mar-06 3:58 
GeneralRe: Process id=0x748 (1864), Thread id = ... error! Pin
mav.northwind4-Mar-06 4:57
mav.northwind4-Mar-06 4:57 
AnswerRe: Process id=0x748 (1864), Thread id = ... error! Pin
leppie4-Mar-06 4:59
leppie4-Mar-06 4:59 
QuestionWhen main thread working the Whole Form Freezes Pin
kourvoisier3-Mar-06 12:20
kourvoisier3-Mar-06 12:20 
AnswerRe: When main thread working the Whole Form Freezes Pin
Sean893-Mar-06 13:16
Sean893-Mar-06 13:16 
AnswerRe: When main thread working the Whole Form Freezes Pin
Office Lineman3-Mar-06 13:36
Office Lineman3-Mar-06 13:36 
GeneralRe: When main thread working the Whole Form Freezes Pin
Sean893-Mar-06 14:09
Sean893-Mar-06 14:09 
AnswerRe: When main thread working the Whole Form Freezes Pin
LighthouseJ3-Mar-06 16:11
LighthouseJ3-Mar-06 16:11 
QuestionRS232 Serial Class with .NET 2.0 Pin
econner3-Mar-06 12:13
econner3-Mar-06 12:13 
AnswerRe: RS232 Serial Class with .NET 2.0 Pin
Office Lineman3-Mar-06 13:39
Office Lineman3-Mar-06 13:39 

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.