|
First of all, don't prefix your classes with "C". This is inconsistent with the .NET Framework. A good RAD (rapid application development) environment requires consistency. Read the Naming Guidelines[^] for more details. Hungarian notation is obsolete in the .NET Framework naming conventions (and CLI).
Is the CCommunicationServer class the fully-qualified class name? If it is defined within a namespace you must specify that as well. If you're getting a TypeLoadException then that indicates the assembly was loaded but the Type (your class) was not found. AppDomain.CreateInstance throws the FileNotFoundException when the assembly isn't resolvable. The documentation indicates as much.
You might also consider setting the AppDomainSetup.ConfigurationFile property to allow your application to use a .config file. These are more important than using them for Remoting configuration data as I mentioned in a previous post to you. You can also redirect assembly bindings and configure other runtime settins as well. It definitely leaves you open to other possibilities. And, once again, configuring your remoting server via a configuration file is far more flexible than hard-coding it. Read about the Remoting Settings Schema[^] in the .NET Framework SDK for more details.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks. Adding the namespace did the trick. My next problem is firing events from the 2nd appdomain to the "main" domain, and I'd like to know is that even possible, so that I don't waste my time?
And thanks also for the naming guidelines, I will check in to that. And now that I have the 2nd appdomain running, I will modify the remoteserver so that it'll use the configuration file. BTW, why is it so important to use AppDomainSetup.ConfigurationFile?
Thank you.
Here: Have a rose for you trouble
|
|
|
|
|
It is possible. And it's called... .NET Remoting. Remoting is a managed RPC framework for communicating between context boundaries. Separate AppDomains - whether they are in the same process or not - are most definitely context boundaries.
Fortunately, the .NET Framework implements a default cross-domain remoting channel but it's pretty limited. Some in-depth research into remoting should mention this, but you should find more information in Ingo Rammers "Advanced .NET Remoting". See http://www.ingorammer.com[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
how can u find out the program files directory in .NET eg (C:\Program Files)
|
|
|
|
|
System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
i do not know how to describe , my English is very poor, so i call it "code pucker" .
Like the vs.net's IDE , you can click the node which at left side of every "{" to pucker the code .
i am very interesting on it , but i am a beginner, i try to read the source code of SharpDevelop, but i feel it was diffcult to me, can you help me?
thanks very much!
|
|
|
|
|
has anyone seen a really great piece of auto complete code? For those of you who dont know what autocomplete is :
'Suppose u have a combobox in which u have a few items added to the collection like "Hello", "Hi" , "Doggone". Now when u type "H" in the box the combobox automatically fills in "ello" for you. So u dont have to type the entire word.
|
|
|
|
|
i have a checkbox on my form and i have written a few lines of code on the checkbox.checkchanged event which fires everytime u check or uncheck the box. This works fine till u check it by clicking on it at runtime but the event doesnt fire when I type checkbox.checked = true. How cn i make the event fire through code..
|
|
|
|
|
If checkbox.Checked is already true, and you write the checkbox.checked = true , then checkbox.checkchanged will not fire, since the checkState is not being changed, Otherwise it will fire.
Check using the statement like
this.checkbox.Checked = !this.checkbox.Checked;
BTW, If you want to call the eventHandler from any where else call like below
this.checkBox1_CheckedChanged(this, new System.EventArgs());
|
|
|
|
|
hi jay,
my code doesnt seem to fire when i type checkbox1.checked = true; even thouhg my checkbox state is false.
please subscribe to this thread so i can reply
|
|
|
|
|
Hi Mridang,
First of all, please go through the msdn documents CheckBox.CheckedChanged[^]
It should fire. There is no bug in the .net, concerning this.
As I said in my previous post, check using again.
this.checkbox.Checked = !this.checkbox.Checked;
or
private void ChangeCheckBoxState(CheckBox cbx)
{
cbx.Checked = !cbx.Checked;
System.Diagnostics.Debug.WriteLine("checked state transformed to " + this.checkBox1.Checked);
}
private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
{
MessageBox.Show("Check Changed");
}
You can explicitly also call the event handler, just to reconfirm as
this.checkBox1_CheckedChanged(this, new System.EventArgs());
I would also advice you to prepare a simple demo project to check the above phenomenon.
Regards,
Jay.
|
|
|
|
|
anyone knows how I can change the window class name of a winform?
now I get something like "WindowsForms10.Window.0.app4"
|
|
|
|
|
Override CreateParams in your derivative class and set the CreateParams.ClassName . If this is not an existing Window class, you'll need to P/Invoke RegisterClassEx and call it prior to creating any instances of your new control class. See http://pinvoke.net/default.aspx/user32.RegisterClassEx[^] for more information.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi
I have a problem regarding events of form controls especially in the order in which they are raised on different operating systems.
For example:
I have LostFocus event for a ListView and GotFocus event for TextBox. When the user navigates from ListView to TextBox we are unable to determine the order in which these two events are fired. We noticed that in some operating systems LostFocus of ListView is raised first but in some other systems GotFocus of TextBox is raised first. This is an example to present the problem.
Can somebody help me out how to control this order on different OS/System? I want to raise the events in a same order though user uses my program on different machines so that I can program accordingly.
Thanks in advance.
Sundar
|
|
|
|
|
try using Validated and Enter events in place of LostFocus and GetFocus events respectively;
|
|
|
|
|
Hi! I'm a 14 year old programmer that has programmed in 4 other languages so far other than C#. I'm creating an IDE for one of the languages, and was wondering how I would go about doing syntax hilighting in a Rich Text Box. Sorry, please
explain it in a way a 14 year old half-newbie at C# could understand! Thanks in advance!
|
|
|
|
|
Akin to my last reply to the question below yours, this site contains hundreds of articles, but you need to search first. Research is just part of development.
Adding to that, the RichEdit control is not the best option. You get inundated in overriding the behavior of the control when defining your own edit control (or reusing an existing control available in third-party controls, either free or commercial) gives you far more capabilities. The RichEdit control itself isn't very flexible. To be more flexible you have to P/Invoke a whole slew of native functions and define several interfaces for interop. In both cases, your marshaling a lot of data between native and managed code. For this reason, I recommend you use Managed C++ for a mixed-mode assembly (containing both native and managed code). This will optimize the calls - especially in the upcoming release of Visual Studio 2005 (more specifically, Visual C++ 2005 using the /clr switch).
For more information about the RichEdit APIs and interfaces, read Rich Edit Controls[^] in the Platform SDK documentation.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I want to add a Column containing Command Buttons to ListView Control... is it even possible... can i have some sample code...
thanx in advance
|
|
|
|
|
This site contains hundreds of articles about many topics, including owner drawing the ListView control, but you need to search to find them.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I'm building a middleware program (client program) that receives data from a Sync Server (a hardware based device which pumps data to the network). The client program is suppose to:
1. Read all the data from the sync server.
2. Compare it to the formated data output (Hex value). If the data starts out as 0x08 then the client will be reading 9 bytes after that. If it shows 0x22 then the client will be reading 5 bytes instead.
The problem I have is the following:
1. How do I read from the Sync Server, when I know how the data format looks like but I have no control over the server side (since it simply pumps the data out to the network)?
2. Then if I'm reading the data in binary how do I convert that to Hex? Hex is easier to manipulate when I need to do a bitwise comparison.
The goal for now:
1. Get it to read the bits from the Sync Server
2. Print each bytes out individually and do some bitwise calculation on it to make sure that i can manipulate it.
Any help is very apprecieated
|
|
|
|
|
|
hello,
I would like to use xml file in multi-user enviroment.
Meaning, i need to allow adding lines to the xml.
my problem is that i don't know how to handle a situation when two users update the xml file at the same time. since the xml is re-written, the first changement will be lost.
so I need a way to prevent two or more access at the same time.
how to do so?
Eran.
|
|
|
|
|
You could use an object of FileStream class to access your XML-file, which provides some constructors that allow you to specify how the file will be shared by processes.
www.troschuetz.de
|
|
|
|
|
An XML file handle concurrency issues very poorly. Changes WILL be lost because you can only have one person writing to the file at any one time. Any writes MUST be done with an exclusive lock, since the entire XML file will be rewritten to the disk every time there is an update.
I would HIGHLY suggest moving the data to an actual SQL server, which is designed to handle concurrency... And I don't mean an Access database.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I've run in to a very strange problem. When I insert a breakpoint in my C# application, the debugger hangs for about 10 seconds and then my form is dead (but not closed). Even the thread it is executing in is gone. If I run the code without any breakpoints, all is fine.
There is one other who has experienced the same problem, but I cannot find out if he solved it or not. You can find his post on "http://www.talkaboutsoftware.com/group/microsoft.public.vsnet.debugging/messages/8688.html".
Has any one else come across this before?
Thanks!
|
|
|
|