|
Looks like a spambot to me!
|
|
|
|
|
Excuse me, but looking at your posting history....
Ummmm, yeah. Do you have any clue about what you're doing, or how to use this website, or any website for that matter?
Your posting history either says you don't have a clue, or just enjoy babbling to yourself. Would you like some help?
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 9:00 Sunday 18th June, 2006
|
|
|
|
|
I have a class which kind of represent something akin to a node in a tree like data structure.
I have some method like that:
class Element
{
IList<int> GetElementPath(); // get the path from the root
Element this[int index] { } // get children
Element this[IList<int> path] {} // descend the hierarchy with given indexes
}
Now I try to add some XML comment to GetElementPath()
/// <returns>The path from the root to this element, to use with
/// <see cref="this[IList<T>]"/></returns>
That doesn't work...
And I have some problem to understand the XML documentation specification.
Could someone shed some light for me? Thanks!
|
|
|
|
|
found it!
<see cref="this[IList{int}]"/>
|
|
|
|
|
I have a collection which inherits Collections.CollectionBase and implements the
public void Sort(Icomparer comparer){ InnerList.Sort(comparer) }
If I use List<> I do not get Sort exposed in the base class. If I use SortedList<> my generic signature changes from <t> to <k,t>.
What I need is something between the two which acts like CollectionBase but is strongtyped. Is there a Generic definition I'm missing? Any suggestions are welcomed.
Thanks.
|
|
|
|
|
is it possible for a file to be open in only a read mode so that it can be edited???
for example i created a program that keeps on reading from a file but when i try to edit the file i get an error [ i am assuming that it is bcuz the program is using the file so it has been lock bcuz when i close teh program i can save it]
this is what i did
File.OpenText(path); [I]this is in a thread that keeps on looping and captures the data[/I]
should i have used file.openText ????????????
kenny
|
|
|
|
|
I recommend to use one of the File.Open overloads. There you can set which file share mode should be used. As those only return a FileStream you would have to construct the StreamReader yourself (not more than a ctor call).
|
|
|
|
|
do you have any example of how i would do this???
kenny
|
|
|
|
|
I really dont know which forum I should ask this question in, so I am just going to ask here.
I need to know how to prepre for MCPD prerequisites exam such as 70-528 & 70-536, any help for you guys like giving me the name of the books etc. would really be helpful.
Also Microsoft suggested these two books:
MCTS Self-Paced Training Kit (Exam 70-528): Microsoft .NET Framework 2.0 Web-Based Client Development
AND
MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0 - Application Development Foundation
But whenever I click on the first link ofr 70-528 it pulls up the second book 70-536... And when I try to search on amazon or barnes and nobles that book does not exist!!
Now my question is how the heck do I prepare for 70-528??
I sure would appreciate if someone could guide me to the right direction. Thanks.
|
|
|
|
|
There is a certification/resume forum. I think I took both exams, and I just used experience to pass them and not a book so I am not a help (except to tell you about the other forum).
Steve Maier, MCSD MCAD
|
|
|
|
|
Hi everyone,
I've been playing with the dataGridView control in C# now for a couple of days, and I've got most all of the functionality that I wanted out of it. One thing I am not able to solve as of yet though I could use some help on. I have a contextMenuStrip associated with my dataGridView control. The way it is working now is that the user has to left click in the cell first (which selects it), and then they right click, it brings up the contextMenuStrip, which allows them to do a couple of things with the data in the cell. I am wondering if there is a way that the user can move the mouse to the cell, right click, have it select that cell automatically, and then the contextMenuStrip that appears will work on the contents of that cell they just right-clicked on. Also, I am wondering if there is a way to disable the contextMenuStrip if they are not in a cell? (Currently, they can click anywhere on the datagrid, even in empty space where there are no rows, and the menu strip will show up there ... I would like the menustrip to only show up when they right click inside of a cell that has text in it).
Thanks much in advance!
|
|
|
|
|
|
ur program returns a value only if he enters the if statement!
u must return also something outside of the if...
Type it the right way!
|
|
|
|
|
Well, read the error. What if a NEVER equals b ? You need to return a default value outside your for each.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
I imagine he was as embarrased about his question as I have been in the past, but deleting it is just bad form. At least I can have a look back at some of my questions now and have a laugh at the odd sarcastic comment thrown!
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
i have five columns for example the first one is ColumnName how can i add in the cell from the first row for ColumnName a string like "Adrian"?
i have something like this
dataGridView1[0, 0] = (DataGridViewCell)"mumu";
Error 1 Cannot convert type 'string' to 'System.Windows.Forms.DataGridViewCell'
Actually what i am trying to do is too send a table from a web service to client application!
Thanks!
-- modified at 18:19 Saturday 17th June, 2006
|
|
|
|
|
i am using now data sets ...but when i log in from my windows application to my web service i get this error ..atention :p
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.\n at Service.AcordaNote() in c:\\Inetpub\\wwwroot\\marius\\App_Code\\Servicep.cs:line 216\n --- End of inner exception stack trace ---"}
i am using sessions
this line 216 ,but i dont think this the problem
if ((bool)Session["loggedp"] == true)
but when i invoke the method from the web service .net test page it returns an xml document with no erors !
WHY?
pls help it is very urgent!
-- modified at 19:53 Saturday 17th June, 2006
|
|
|
|
|
Hi
Not sure how to explain this, but here goes. I have a method 'ShowFormForLong' which recieves a long as a parameter. It checks a Dictionary to see if the dictionary contains the long as a key. If it does, the object stored is a form, and the form is 'shown'. If the dictionary doesn't contain the long, a new form is created and added to the dictionary, and shown. Works a treat when the long is entered by the user, they press 'Go' button, and the onButton event calls the ShowFormForLong method.
But...and there always is a but....my app allows sockets to connect, and the socket can recieve a 'long'. I read a long from the socket, and fire an event, which my main form subscribes to. The eventargs contain the 'long' and I call 'ShowFormForLong' passing the long from the eventarg. But this time, the form is shown, but it seems as though the message loop isn't running in the form, as only the background is drawn, no controls are visible, and then the app crashes.
I will get the code on Monday, and post if nobody has any ideas, but is there something I should be doing? Or is it something as simple as I can't create multiple forms...
From memory...
Dictionary< long , MyFormClass>formDictionary;
void ShowFormForLong( long myLong )
{
if (formDictionary.Contains(myLong))
{
MyFormClass myForm = (MyFormClass)formDictionary[myLong];
myForm.Show();
}
else
{
MyFormClass myForm = new MyFormClass();
formDictionary.Add( myLong , myForm );
myForm.Show();
}
}
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
-- modified at 16:05 Saturday 17th June, 2006 - typos
|
|
|
|
|
Angel1058 wrote: But this time, the form is shown, but it seems as though the message loop isn't running in the form, as only the background is drawn, no controls are visible, and then the app crashes.
Do you know when the crash happens, the long you got from the socket matches an existing one in the dictionary, or is a new one added to the dictionary? Or it crashes in both cases?
- It's easier to make than to correct a mistake.
|
|
|
|
|
hi Jun
It crashes in the show with a CLR exceptino - Unhandling exception of type "System Exception" occurred in Unknown Module or something like that. The long can exist or not, crashes on both cases, but I think Roberts suggestion below is the answer - cross threading!!
I love this place. New to C# / .NET. Good at C++ and MFC, but this CLR is all good stuff!!
Thanks for your time anyway, much appreciated
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Not sure on this but may the event coming from the socket connection be called from a different thread then the GUI was created on. If yes use Control.Invoke to transfer the call to the appropriate thread.
|
|
|
|
|
Yes it is, the app listens to the socket on its own thread, so the user can do what they want without the app blocking on the receive (not up to async sockets yet!!). So, that could well be the problem. Haven't come across Control.Invoke, so off to google now.
Thanks to both of you for answering. I will post back with the results.
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Hi
Just been messing with some code - the main application form (which created the second forms based on the 'long' is in thread 1 . I output Thread.CurrentThread.GetHashCode just before the second form is displayed to determine this.
When the socket event is fired, the thread is now Thread 3 . This is where it gets confusing. Calling a method on the main from (created from thread 1 ) from thread 1 , works, and creates the second form a treat. Calling a method from the main form (created from thread 1 ) from thread 3 , fails, and the second form doesn't work.
Is this what you're saying? I should only call methods from the main form, from thread 1 ?
I've looked at Invoke, but not got a clue how to use it with events.
If you can confirm the above I will go away relatively happy and know what the problem is.
Cheers
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Yes that is what I mean. Its generally unsafe to change GUI elements from another thread than they were created in. Like in your case this will normally not result in an immediate exception but some weird behaviour. This even depends on which OS you are using.
The following snippet will demonstrate how to use Invoke with the standard EventHandler signature:
private void OnEvent(object sender, EventArgs e)
{
if (base.InvokeRequired) {
base.Invoke(new EventHandler(OnEvent),
new object[] {sender, e});
}
else
{
}
}
A bit of explanation:
InvokeRequired just checks if the current thread is the one the form was created in or not. Invoke will then transfer the call over the thread boundaries. Thus this function (when called from a different thread) will call itself again within the correct thread. Note that this call may block if the GUI thread is busy and wait till its free. You could also use BeginInvoke. Then the call would not block while the GUI thread is busy and the thread could keep running. The call would than be made the next time the GUI thread is free.
|
|
|
|