|
It's supposed to be a wrapper. The ability to P/Invoke makes framework extensible, although not portable as you mentioned. I haven't checked yet, but I'm betting Mono does support P/Invoked calls, albeit in a different library. I'm not defending this design, just mentioning that Microsoft has been very clear about this. It's not another Java - similar concept, different implementation. The JVM takes care of all the OS-specific operations, but the CLR is meant only to manage the objects and provide interoperability services. It sure beats JNI! (Trust me, I know). I guess you could say that they really differ most on how they handle native calls and both have advantages and disadvantages in the way they handle them.
Also, sorry I didn't notice that you said "system locale" in your first post. I read the thread before I posted originally and guess it just completely slipped my mind.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
while(sReader.ReadLine()!=".")
{
retrMessage.Add(sReader.ReadLine());
}
sReader , my StreamReader reads a network stream from a POP3 server one line at a time and adds it to my array retrMessage[] .
Well, at least... it DID. I changed retrMessage from a string[], to an ArrayList. And now for some reason, only every other line is stored into the ArrayList (it skips lines).
Um, I'm assuming that this is an arraylist problem, because the string[] was handling it fine.
Does anybody have some inside on what's going on, and how I can fix this?
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
while(sReader.ReadLine()!=".") { retrMessage.Add(sReader.ReadLine()); }
That code is just wrong, I'm not gonna even read the rest, try spot the mistake!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
|
Hint: When you do a ReadLine the stream advances.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
So, this is a StreamReader problem...? I though it had to do with the ArrayList... hmm...
/\ |_ E X E GG
|
|
|
|
|
Yes, it's the StreamReader (actually, any stream or reader), but it's not a problem. This is the behavior of any IO on every platform I'm familiar with. You read, the cursor advanced.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
No! It's a logical error!
Step 1: You read a line and check if it is not "."
Step 2: You read a line and add it to the arraylist.
So you have to ask yourself one question, what happened to the string in step 1 if it wasnt "."?
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
ohhhhhhhhh.
I see, let me mess with it.
/\ |_ E X E GG
|
|
|
|
|
string feed=null;
while(feed!=".")
{
feed=(sReader.ReadLine());
retrMessage.Add(feed);
}
There it is. I hope you had fun laughing at me.
/\ |_ E X E GG
|
|
|
|
|
leppie wrote:
That code is just wrong, I'm not gonna even read the rest
- Nick Parker My Blog
|
|
|
|
|
Could anyone point me to a multiline (text of an item can be displayed on multiple lines) listview Windows Forms control?
Thanks
|
|
|
|
|
Trying searching[^] first. There's a ton of examples of this on CP alone, besides what the link above provides. It's just an owner-drawn ListView which is trivial to do. You could also google for it.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks, but I searched first and then asked for help.
|
|
|
|
|
Do you need a ListView or a ListBox ? The samples that are available are vastly different, and owner-draw ListBox examples are far more plentiful because they provide managed support for owner drawing, where a ListView requires that you override a hell of a lot of Windows messages and handle many different notification messages.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I need a ListView control.
|
|
|
|
|
At this time, there isn't many articles on CodeProject about this. There was one, but the guy used CodeProject as a testing front for what he later turned commercial.
To know what you need to do, research the Windows Common Control ListView. There are messages and notifications that you must be familiar with. After this, you override WndProc in your ListView derivitive class and handle those notification messages. You'll probably also have to P/Invoke several methods (especially SendMessage ) and create constants that represent message ID, and several structs.
You can try googling for an example, too.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
Carlos, just curious if you plan to continue posting your articles here, they are always full of great information and a great learning tool.
- Nick Parker My Blog
|
|
|
|
|
Hi Nick,
I would like to write a series of articles on WinFX --or Avalon, or whatever the name for new technology for writing Windows Application in Longhorn will be.
Probably, when Longhorn gets into beta and things get more well defined I will start posting some of my findings here. The new batch of technologies making a debut in Longhorn will surely keep us busy for years to come and I am certainly looking forward to sink my teeth on all the information related with the new UI model.
Regards,
Carlos.
|
|
|
|
|
True, I am looking for a free one, but I've saved your link for time when I will develop software for sale. Thanks
|
|
|
|
|
|
Thanks. I will check it out. This seems to be what I need. No source code, though. 
|
|
|
|
|
The source is in the demo project.
|
|
|
|
|
Is it possible to somehow specify the text of the MessageBox buttons?
I'd very much like some "Yes to all" and "No to all" options, but the aren't many standard button titles to schoose from 
|
|
|
|