|
Hi Dave,
Thanks for your reply. Well my cirteria is that all the clients in the network have to broadcast a keep alive message so that the server can receive the packets. The packets will basically contain the Computer name of the client and the port number it is listening at.
Is UDP a good choice for this or is there any other better model for it?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
The CLIENTS are broadcasting this information? This is a backwards idea that can be taken advantage of. The server can't broadcast a stream to different port numbers without broadcasting the same stream multiple times.
It should be that the SERVER broadcasts what its name is and any additional information the clients might need to connect to the server, such as a different port number. The clients can listen for that information being broadcast. If the clients do the broadcasting, suddenly your flooding the network with all kinds of broadcasts, instead of just one.
You CAN use UDP for this, but keep in mind what I said in my other post. UDP doesn't garantee delivery of anything! Can your data model withstand clients not receiving information with no ability to request a re-transmit.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
MarshalByRef is required only for remoting. For simple serialization to a file or a socket stream, implementing ISerializable (or using the [Serializable] attribute) should be fine.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
S. Senthil Kumar wrote: MarshalByRef is required only for remoting.
Thanks for the info.
S. Senthil Kumar wrote: For simple serialization to a file or a socket stream, implementing ISerializable (or using the [Serializable] attribute) should be fine.
The class which is being serialized, should it be kept in a separate assembly, because when I kept the class being serialized in the same assembly which was broadcasting the meassage, it couldn't be deserialized in the receiving assembly. It gave a SerializationException saying that the "Client" Assembly does not exist.(Client being the name of my sending assembly).
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Hi,
I have recently intalled the Express Editions from Microsoft, and automatically installed Framework 2.0. What will happen if I install Visual Studio 2003 which comes with Framework 1.1? If I create a web project in Visual Web Developer, how will it know what Framework it will use? Won't there be any conflicts if various Frameworks are installed?
And if I compile a project, how does it know what framework to use?
Regards
ma se
|
|
|
|
|
iis configuration mmc plugin's virtual dir property page has a tab called asp.net that maps which runtime to work in. just Control panel-> administrative tools-> iis -> select virtual dir and right click ; in menu properties the tab with asp.net look at it....(it configures by web.config)
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
Hi again.
When any other window gets on top of a pictureBox, that region of the pictureBox becomes shaded (doesn't refresh) when closing that window on top. I've tried to use the Update() method in the Paint event, but it doesn't work.
How can I do this?
Thanks.
|
|
|
|
|
How do I play two sound files at the same time without one cutting out?
I can not do that with PlaySound API.
Please help me.
|
|
|
|
|
Just a thought but can it be done with the PlaySound API running on separate threads?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
I'm trying to get custom application icons but I can't seem to have a 16x16 AND a 32x32 application icon to load correctly. Basically I have a custom Application icon and a document icon. I am noticing the document icon is correct. Both on the application side and even in the Windows explorer side. Even when I change the Explorer view the icon changes size correctly. Now with the application icon, this isn't the case. This is the code I have in the resource file for my main window application.
IDR_MAINFRAMEGAMEMASTER ICON "res\\icon1.ico"
IDR_CGAMEONTYPE ICON "res\\calendar.ico"
IDR_MAINFRAME ICON "res\\CGameOn.ico"
icon1.ico is the 16x16 icon
calendar.ico is the document icon
CGameOn.ico is the 32x32 icon.
IDR_MAINFRAMEGAMEMASTER is the main frame I load when I set my configuration manager to "release". I also have a setting called "release -basic" in my configuration manager as well. I usually compile under the release therefore I am using the IDR_MAINFRAMEGAMEMASTER resource. The configuration above with the code I have will result in the application icon to be changed correctly as well as the explorer window to display the correct icon. But when I open the About box or change the explorer view to icons I get blanks. I'm not sure what is happening in why I get the document icon to work but not the application icon.
Any help would be appreciated.
Thanks!
|
|
|
|
|
Dear all,
In a C++ Windows Form application with several forms, and several generic C++ clases. I want to call the Main Form pointer or object form these other forms and classes, but do not know how...
As you can see, i'm very new to .NET!
Any help will be wellcomed, Thank you in advance!!
Eloy
|
|
|
|
|
Windows Forms does not use the MFC application model. I think you'd have to save your main Form somewhere. Alternatively you could enumerate Application.OpenForms, but again, figuring out the main form would involve traversing the parent-child hierarchy and all sorts of complexity. It'd be much easier to just save the main form in some static property that can be accessed throughout the app.
|
|
|
|
|
if your project or application is named "Foo" then the main form object is the Foo. Just add a static Foo^ class variable to your Foo class and initialize it in the constructor.
for example:
public ref class Foo: public System::Windows::Forms::Form
{
public:
static Foo^ myFoo;
Foo(void)
{
InitializeComponent();
myFoo = this;
...
}
...
};
Then, elsewhere in your code you can refer to your "main" form class as Foo::myFoo
hope this helps
|
|
|
|
|
Hi
Does any one know how to change the UserStrings Values in the .Net Metadata in code?
|
|
|
|
|
huh? explain what you're trying to do please.
|
|
|
|
|
Thanks for th reply.
Firstly I created resourcestrings in Delphi for .Net to keep Strings seperate in the assembly that is available to change with a resource editor.
These strings are saved in the .Net Metadata in the assembly under UserStrings.
I need to change these values inside the app, not with a external resource editor.
Delphi for .Net Code
resourcestring
StrPlay = 'Lets play'
C# code
const string StrPlay = 'Lets play'
This whole thing is to change the whole app between different languages on the fly. Form changes work 100% on the fly. The problem is the strings that is hard coded in the source files that needs to change between different languages.
Hope this explain it better. I can explain in futher detail. Any code examples in any language will help.
Thanks for helping!
|
|
|
|
|
1. you should never hard code strings in the source files if you want to be able to easily do localization and internationalization.
2. create a separate resourcestrings assembly file for each separate language, named appropriately (typically using the standard 2-letter designation for each language).
the naming convention is usually something like:
<assemblyname>.en.dll for english
<assemblyname>.de.dll for german
and so on where <assemblyname> is some resonable name
3. unload the current resource string assembly and load the one for the desired language
does this help?
|
|
|
|
|
Thanks.
Can you give me some example code that shows how to load and unload the resourcestrings dynamically in a app.
I read that resourcestrings load only at app start up according to locale and that you cannot change the resourcestrings dynamically.
|
|
|
|
|
I am using the System.Threading.Timer timer.
Now if I have a interval set quite low say 10ms it is possible for my timer event handler to be queued as they cannot be prcessed because the UI thread is busy or another application is running. When the UI thread becomes free it then processes all the queued events at the same time.
Is it possible to determine programmatically the number of timer event handlers that are being queued. I want to be able to determine when there is a build up of queued event handlers.
Some code to demonstrate this would be useful.
Also, is it possible to limit the number of timer event handlers that are queued?
Thanks,
Liam
|
|
|
|
|
The Timer your using doesn't use events at all, so what your asking is pointless. The Timer "Tick" calls your code directly using a seperate thread out of the thread pool for each "Tick".
But, if you were referring to the Forms-based Timer, that uses a Timer Tick event.
LiamD wrote: Is it possible to determine programmatically the number of timer event handlers that are being queued. I want to be able to determine when there is a build up of queued event handlers.
No. I think you're limited to Peeking at the next message in the message pump, without actually processing it. I don't think you can peek at the entire message queue. Also, this process would take longer than the 10ms you have between events.
LiamD wrote: Also, is it possible to limit the number of timer event handlers that are queued?
No, it's not. The best you can do to prevent a stack of tick events is to disable the timer at the beginning of your Tick event handler code, then reenable it at the end. This will, of course, throw off your 10ms pace, but your code will be executing the Tick event as fast as possible. 10ms is not alot of time to do much.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi every one,
I am trying to develop a windows application which will run on touch screen LCD monitor.
but the touch screen requires bigger option button,check boxes, tab pages, scroll bars etc. in such a way that the enduser select the controls using his finger.
How can i adapt the .net windows controls for the touch screen application (like changing size,graphics etc.,)?
or is there any special controls available for touch screen in .net?
or is there any tool available to convert the normal controls to touch screen controls??
Please help...
Thanks & Regards,
Srini
srini
|
|
|
|
|
Hi All,
I have a customised installer class inherited from System.Configuration.Install.Installer class.
Customised installer class again works as a base class for CustomInstallerExtended class which in turn is a base class for module wise installers as per my requirement.
Scenario is like this:
MyCustomInstaller inherits System.Configuration.Install.Installer
MyCustomInstallerExtended inherits MyCustomInstaller
InventoryInstaller inherits MyCustomInstallerExtended
I wanted some "custom action" before uninstallation of my inventory module. Say for example I want to execute some stored procedure before uninstallation.
In this case if a public overridable method say "OnBeforeUnInstallation" is given in MyCustomInstallerExtended class, which internally gets called on protected method "OnBeforeUnInstall" or any other relevant method given by windows installer, then the custom code can be written in the public overridden method "OnBeforeUnInstallation" in InventoryInstaller.
OnBeforeUnInstall method being a protected overridable method of windows installer class,it will not get fired in MyCustomInstallerExtended class.
AnyOne please help me out to know how OnBeforeUnInstall method can be used effectively to over come my problem statement or is there any other way out to solve the above mentioned problem?
HV
|
|
|
|
|
Hello!
I want to draw points and lines in a picturbox previously loaded with an image. (C#.NET 2k3)
I am trying to do something like drawing a red point where I click on the image. I do this, for example, in the MouseUp event, but nothing happens:
Graphics graph = Graphics.FromImage(pictureBoxHM.Image);
graph.DrawEllipse(new Pen(Color.Red),400,400,400,400);
pictureBoxHM.Update();
Any clues, please?
Thanx in advance!
-- modified at 20:03 Wednesday 4th January, 2006
|
|
|
|
|
It's amazing to me how many people continue to use a picture box when they move beyond what it's designed for. Why not just keep a bitmap in memory, and draw it yourself ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi there!
I'm developing an application with C#.NET 2003 and I want to use a web service I just created on the same computer to test it.
What I've done is to add the web reference (called "localhost" as default). Now I want to declare an instance of that service "localhost.Service1 s = new localhost.Service1();"
but the code preprocessor can't see it. When I try to compile it tells me a reference might be missing, but I actually added it.
I tried to create a new project, and it does add it correctly. Why in my application it doesn't? It's a windows form app.
Help, please!
NOTE: I just observed that localhost namespace is different! How can I change it????
-- modified at 12:55 Wednesday 4th January, 2006
|
|
|
|