|
public abstract class MyClassNname
At that point, it MUST be derived from in order to use it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Yes, but that's not entirely what I want. I want a derivable singleton. The base class is a singleton*, and any derived classes must also be singletons.
* Using a loose definition of "singleton", that considers a class with only static members as the zeroth instance.
modified on Monday, June 16, 2008 4:06 PM
|
|
|
|
|
Hi All,
I have a routine i'm working on that parses a file looking for chunk information. There are various possible chunks and some chunk types (that I have defined as structs) can sometimes occur more than once in any given file.
What is the best solution for having a single collection that can hold all/any of these created structs? Can I define a generic collection like:
List<Object> _wavinfo = new List<Object>();
I've not worked like this before, would be good to know if this is a sound idea or if there is a better method. Would it be better to have a strict definition of the object I know will only be created once and List<T> for the object I know might occur more than once?
I'm basically trying to keep the memory footprint as low as possible.
Cheers,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
List<object> works fine for that.
But using classes (rather than structs) with a common base class may be somewhat better.
Jammer wrote: I'm basically trying to keep the memory footprint as low as possible.
You probably needn't worry about that.
|
|
|
|
|
Hi,
Gotca, thanks for that, I started progressing with a List<object> . The problem is the similarity between these chunks is limited to just the ID of each chunk, after that they are all completely different in structure making a base class tiny. Or am I missing the point?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Then stick with the List<object> unless you think someone may put something else in the List.
It kinda depends on what you need to do with the things.
|
|
|
|
|
How do I change the text of a window? I read the article regarding Window Tabifier and tried using the code. However, this produced read-only results.
Thanks in advance.
|
|
|
|
|
You can use SetWindowText Function[^] You will need some P/Invoke to get it working, I'm sure www.pinvoke.net has some examples.
That Asian Guy wrote: I read the article regarding Window Tabifier and tried using the code. However, this produced read-only results.
Yes, the class I used in that application has read only properties. You can however extend it for your needs.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Thanks, is there a way to change the icon as well?
|
|
|
|
|
I'm not aware of a function that changes icon of window
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Thanks, I went on pinvoke.net, but what should I set as the value of IntPtr?
Thanks.
|
|
|
|
|
You should pass handle of the window for which you want to change text.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Thanks, but how do I obtain this value?
|
|
|
|
|
|
Alright, thanks it works!
|
|
|
|
|
Glad to help you
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
I made a pretty easy loop but this loop runs 4 billion times this takes about 90 minutes to complete.
Now i would love to use my dual core and make it go faster!
Now my question how do i do this?
I can divide my loop in 2 and left loop1 do 1-50% and loop2 do 50-100%,
If i run this in 2 threads will that work?
Or do i need some other kind of code?
Also do i need threads or will background workers do?
Thanks!
|
|
|
|
|
It depends on what you are trying to accomplish. What operation is happening in the loop?
background workers are threads.
|
|
|
|
|
Im changing some bytes in a buffer, then preform a calculation with the buffer.
|
|
|
|
|
If you're not IO bound (ie the bottleneck is reading from the HD or copying the buffer from ram to cpu cache) splitting it in half and having 2 threads work at once would give a good speedup. If the modification/calculations are trivial though you're probably IO bound not CPU bound.
You know, every time I tried to win a bar-bet about being able to count to 1000 using my fingers I always got punched out when I reached 4....
-- El Corazon
|
|
|
|
|
|
I don't know if this is even possible, but I am looking for a way to programmatically tell whether a tablet is connected to the network wirelessly or is it connected to the network using a network cable plugged in. All the ways I've found just say whether it's connected or not and doesn't tell how it is connected.
Thanks for any help
Brent
|
|
|
|
|
System.Net.NetworkInformation.NetworkInterfaceType contains that info. Look in the System.Net.NetworkInformation namespace on how to access that information.
|
|
|
|
|
Thanks, that's exactly what I was looking for.
Brent
|
|
|
|
|
I have created an 'grid' of text boxes 17 (rows) by 20 (columns) within a groupbox.
This is like using a conrtol array in VB6.
I gave each a unique name e.g. txtboxR08C12 (row 8 column 12)
Just prior to adding the control to the group box I added an EventHandler to the textbox.
How can I identify in the EventHandler exactly which of the textboxes (preferably by name). So that I can amend the background colour and the contents to reflect a count (determined elsewhere in my code and stored in an array)
|
|
|
|