|
I think you can pass an IComparer to Sort(), just write your own FileInfoComparer.
|
|
|
|
|
Last time (1996) I developed with Delphi, there was a control with seperate "pages" to visually put controls onto and then switch the "pages" by code.
I.e. like a TabControl, but without displaying the tabs. Something like a "StackedPanelControl ".
Is anyone aware of such a control for Windows Forms 2.0?
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
I don't think there is a similar control. I would imagine that rolling your own control using Panels wouldn't be very difficult.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is the MarshallByRefObject class only used in Remoting or can it be used in the case of Windows Sockets too? Supposing, I want to serialize a class and send it over a UDP Socket connections to all the clients, then does the class have to be inherited from the ISerializable interface or the MarshallByRefObject class?
Can anyone help?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Do you really think that sending a serialized class over UDP is a good idea? UDP does not garantee the arrival of packets, but more importantly, it doesn't garantee that they are received in the correct order!
Your deserialization code must be able to put up with this eventuality and be able to recover from it. What is the impact of not being able to recieve this object on your client, ... server? Can your data model withstand a few, some, or all or your clients not receiving this object?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
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
|
|
|
|