|
Using the TV example, the TV remote turns off the TV when you hit "Power". It does not do "a turn off the IR sensor". If it did that your remote is now a brick. As long as you aren't using .Net Remoting to tell .Net Remoting hosted objects (or a higher abstraction the server/IIS) to close then you are okay. For instance, having a web page in IIS to make IIS to kill itself is a receipe for disaster because of race conditions.
You seem to have a misunderstanding on what .Net Remoting happens to be. The client domain and the server domain certainly are not running in the same process. For instance any reference changed on one domain will not automatically appear in the other domain. The client can simulate synchronization by "blocking" on the response from the server. Things like garbage collection can happen at any moment, independently on either the client or server application domains. You can just as easily do an asynchronous response. The client domain is more than happy to process independent of the server domain and vice versa. Also the assumption that only one client is communicating with the server has to be a strong assumption because .Net Remoting will not enforce that. If your client application exits abnormally will the next client application be able to talk to the server?
One feature of .Net Remoting is that the client domain doesn't have to continually "ping" the server to keep objects alive in the server domain. Once again this is done so the client and server domains can operate independently. The client shouldn't bother finding out what the status of the server domain until it is called upon. There is no need to tell .Net Remoting to clean up itself any more than any other .Net technology (although the facilities are there if you want to twiddle the settings).
I wish you luck on whatever it is you are doing but I would recommend staying away from cross domain delegates and using singleton/single call remoting styles for administration tools.
|
|
|
|
|
I don't agree about the intranet thing. If you are concerned about proxies/firewalls, you shouldn't be using TCP, you must be considering using HTTP. Not using delegates means that you won't be able to subscribe to events from the server, do you consider that too to be bad design?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Http is just built upon TCP. If you have any situation where you map "many to one" how do you traverse the firewall/network translation? The server only sees an IP plus any information carried along in the Http header. Simply put, how does the server initialize a connection to the client back? You can do it as a response because the client initialized the connection. It is much harder when the server needs to initialize.
For a client-server situation, delegates aren't the best thing to use. As stated since they are in entirely different application domains (let alone different processors/machines) and since delegates are not interupts how in the world can you possibly use them correctly? How do you gaurentee the client is ready to respond to the delegate? You simply can not.
If you want delegates with a setup like that, put the delegate on the client side. Call the server , check the response, fire the delegate from the client to the client. Expecting a server to figure out how to handle a delegate to a client just work out well (believe me I've tried).
|
|
|
|
|
as topic, how do i obtain the screen resolution of user?for example 1024*768 or 800*600...thz..
|
|
|
|
|
This is slightly complicated by the fact that a user can have multiple screens.
The class/object you want is System.Windows.Forms.Screen.
If you only care about the main screen,
<br />
Screen mainScreen = Screen.PrimaryScreen;<br />
Size dimensions = mainScreen.Bounds.Size;<br />
If you need to support all screens, you will need to operate on the Screen array returned from Screen.AllScreens.
Regards,
Ray
|
|
|
|
|
Hello Friends,
Our clients requirement is that we have to use their DLL which is created by C,C++ code.
What I am doing in my code is that :
1. using using System.Runtime.InteropServices;
2. [DllImport(@"g:\SampleDLL.dll",EntryPoint="test",
SetLastError=true,
CharSet=CharSet.Unicode,
CallingConvention=CallingConvention.Winapi)]
3. static extern int test(int lpLibName);
4. and in code calling test function with parmeter as 10.
But I am getting error that entry point "test" not found in SampleDll.dll, but this methods defination written in that dll itself.
Please help me out of this.
Or tell me is there any other way to use that dll?
Sachin Gedam
(Software Engg.)
Pune India
|
|
|
|
|
It's COM you're after.
Here's a little appetizer
http://www.codeproject.com/dotnet/cominterop.asp
|
|
|
|
|
sorry but its not a COM object, its simple a compiled dll created by old school level C,C++ language. And we have to use that dll in our .net project.
Sachin Gedam
(Software Engg.)
Pune India
|
|
|
|
|
|
Im try to open another window with some options in it for an app. but when i try to run it i get an error message "It is invalid to start a second message loop on a single thread. Use Application.RunDialog or Form.ShowDialog instead."
But i dont know how to do the sugestions, the main app can close after the options window is open - if thats any help.
|
|
|
|
|
can u show the code where u start the second form?
|
|
|
|
|
The error message means that you tried to call Application.Run from within the UI thread. Can you show us the code that opens the other window?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
So thats the problem, yeah im trying to open it from a button click within the form.
Would i be able to use a 'goto' and put the application.run somewhere else?
public void buttonOptn_Click(object sender, System.EventArgs e)
{
Application.Run (new ChangeText());
}
|
|
|
|
|
You needn't (and shouldn't) do that. If you want the form to be opened to be modal (ie that form takes the focus and you won't be able to go to the main form until you clost it), simply do
MyNewForm f = new MyNewForm();
f.ShowDialog(this);
If you want it to modeless, instead of calling ShowDialog , just call Show()
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
dear all
i need help in how to play flash in C# application
thz all
|
|
|
|
|
The easiest way is to embed a web browser instance inside your app..
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
there's an easier way. If you go to your toolbox add in manager, and search "flash player", there is a ready made component by macromedia you can simply check to add to your toolbox. Drag it to your form, and there is a property that you tell it to navigate to a url or local file to play. I'm not sure exactly what the "flash player" is called, but it is something like that. Hope this helps.
|
|
|
|
|
its helpfull
many many many thx
|
|
|
|
|
hi,
any method to add versioning information automatically in .NET? or, any method to place the build date/time in the source file then i can read it back in the binary?
thanks,
jim
|
|
|
|
|
No, but you can easily read the PE filetimestamp using the following.
DateTime compiletime = new DateTime(1970, 1,1).AddSeconds(BitConverter.ToUInt32(data, 136));
where data is a byte[] representing the PE file (assembly).
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
|
yes, this is great! thanks!!!
|
|
|
|
|
Hi
Does anyone knows if there is any ICQ client on C# under project?
Thanks
|
|
|
|
|
|
I'm doing one, and the ICQ library (I'm calling in NOscar, similar to Java's JOscar) is already working.
I did not upload it to my homepage (German, www.danielgrunwald.de) yet, but if you want to take a look at it, send me an email.
|
|
|
|