|
Griff:
I see exactly what you mean. Knowing that I am dealing with references rather than the actual values is the key, and I would not easily have discovered this as the code "looks correct".
I'll head off to do a bit of reading and Googling for the right way to solve this.
Thanks for the lesson - I bet this will prove to be a valuable piece of information in making the jump from C to C#.
Chuck
|
|
|
|
|
You are welcome!
The transition from C to C# isn't too bad once you realize that all classes are on the heap, and thus all class variables are effectively C pointers to variables without the "->" all over the place.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
I want to be able to know what is the fallback mechanism for a language, and do it in code.
for example: i have files that aren't resource files but are different for different cultures.
i want to search manualy for a culture directory according to my culture. and if i don't find it there, i want to search for the fallback culture and so on, till i get to the root directory if the culture isn't found.
My question is: how can i find the "next fallback" culture for a given culture, thru code.
Thanks,
Yanai
[SOLVED]
The CultureInfo class has a "Parent" property just for that
modified on Monday, August 31, 2009 7:28 AM
|
|
|
|
|
I am analysing data which contains several different object types and would like to get them in a single collection but need to keep them in order.
I could use a dictionary and lists of each type but it would be easier (and maybe quicker) if I could have a single collection of the objects as the order the lists are in the original data is important.
Any suggestions on a reasonable method?
Thanks.
Elaine
modified on Sunday, August 30, 2009 12:16 PM
|
|
|
|
|
object[] ? ArrayList ? List<object> ?
|
|
|
|
|
Thanks PB, I'm still learning about collections.
|
|
|
|
|
Collect items of the most specialized common type, Object[] or List<Object> would always work; if you have some intermediate base class, that would be even better. So for a drawing it could be Shape[] or List<Shape> where your shapes inherit from your base or abstract Shape class.
|
|
|
|
|
A good idea, the other method would be something akin to the MFC VARIANT type where the members are the class types I need to put in the list.
I'll try your suggestion first.
Thanks Luc.
|
|
|
|
|
NP
|
|
|
|
|
Hello,
i had a running UDP-Server, but had the problem, that only every second package coming on. So now i wanted to re-code it with Socket and not using the UdpClient.
If i want to receive a datagram with Socket.EndReceiveFrom(ar,ref ep) it doesn't works. I get a NullReferenceException (i think the "ep" is the problem), but if i use Socket.EndReceive(ar) it works well.
Here the code:
string szData;
IPEndPoint ipe = new IPEndPoint(IPAddress.Any, 0);
EndPoint ep = (EndPoint)ipe;
int len = parent.udp_listen.EndReceiveFrom(ar,ref ep);
szData = Encoding.ASCII.GetString(buffer, 0, len);
"parent.udp_listen" is the public UdpClient which is in another class.
So what's wrong... is there another possibility to find out who is the sender of the datagram? Because i need the IP Address and the sending-Port of the sender.
Thanks
|
|
|
|
|
Is there a job market in Aus for C#.net asp.net ???
Just curious ...
|
|
|
|
|
Is this the right section to post this ??
|
|
|
|
|
Well, where the hell would you post it ???
|
|
|
|
|
Probably in the Lounge[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
No, to my knowledge Australia is not allowed to use .NET, let alone C#. This is why Chris Maunder moved to Canada.
|
|
|
|
|
Well thats encouraging ...
|
|
|
|
|
hi.
i have webpage that contain textbox. here is textbox code:
<input name="cardtxt1" maxlength="4" id="cardtxt1" tabindex="1" class="txtform" onpaste="doNotPaste()" onfocus="getName(this);documentFocus('cardtxt1');" onkeypress="return check_KeyPress(this,2,'0123456789')" onkeydown="noCTRL(event);" onkeyup="nextTab(this, false);" autocomplete="off" style="width: 32px;" type="text">
and i want set textbox value by this command:
HTMLInputElement card = (HTMLInputElement)doc.all.item("cardtxt1", 0);
card1.value = Value;
but my problem is after DocumentCompleted there is no value in textbox. value assigned to textbox before it get focused and when textbox get focused value will be cleared in textbox. how can i assign value to textbox after it get focused ?
or can i remove focus on textbox ?
|
|
|
|
|
I'm get in stuck of deployment an desktop application. My app was compiled against .net 3.5. On machine that doesn't have .net 3.5, the setup has to download .net 3.5 before install the app. The problem is download .net 3.5 take close to an hour, then user might cancel installation process.
I already compiled my app against .net 3.5 client profile, but it still take 5-10 minutes to download and still let users go away.
I dont know if there's a way to embed .net class library into my desktop app, so it could run without .net frx, or could we compile the app into native code?
Please help me if you have answer
Thanks.
|
|
|
|
|
No. Just mention it in the documentation or download site or whatever so that potential users know that .net is required before they download your app.
Most Windows systems already have it, so I wouldn't be especially concerned.
|
|
|
|
|
Almost user have .net 1.1 or 2.0. Since my app used .net 3.5, they have to have close to 1 hour to download .net 3.5 which will let users go away...
|
|
|
|
|
But that's really none of your concern.
|
|
|
|
|
It's absolutely my concern
|
|
|
|
|
AFAIK Windows Vista and Windows 7 have all versions of .NET up to 3.5 preinstalled; as 3.5 is a pure superset of 2.0 (and much larger), if you don't really need the new stuff (such as WPF), it could be advantageous to build against 2.0 as this has even better chances of being present (on XP and older), and when not will download faster. I build against 2.0 unless I really need one of the extensions...
|
|
|
|
|
Indeed, build against the lowest version you can.
Don't use the latest features unless they offer a real benefit.
|
|
|
|
|
Thank guys.
Bad news is i used WPF, then i could compile against .net 3.0 or 3.5. 3.0 is as fat as 3.5, then i compiled against .net 3.5 client profile.
However, it also took close to 10 mins to download .net 3.5 client profile, then i'm looking for better solution...
|
|
|
|