|
can anyone suggest me the simplest way of sorting a datagrid
|
|
|
|
|
|
Hi!
Im facing a very strange problem, im doing a project in C# 2005. it waz all going well until 2day, my project is being built successfully but no output is shown.
i didnt made any big changes in project, it waz working perfectly but all of a sudden it stopped showing output...also no error or exception is being showed.
I tried almost every thng, closed app, restarted system, copied all code in new project and recompiled it, but no result...My Visual Studio is running all other projects perfectly so there is'nt any problem with it.
Please help me in this regard, im 2much worried abt it.
Regards,
Affan Ahmad Toor
|
|
|
|
|
Check the project properties: what does it say for project output? What happens when you do a "Rebuild All" on your project?
p.s. you're more likely to receive help if you spell whole English words, rather than substituting them with IM-speak like 2day, waz, abt, etc.
|
|
|
|
|
Judah Himango!
Thank you for reply and the suggestion, next time i will keep it in mind.
no error is shown when i Rebuild All project. It displays message in status bar "Rebuild All Succeeded"
the project properties are default and i did not changed them at all.
can you suggest what is the reason behind this strange behaviour?
Regards,
Affan Ahmad Toor
|
|
|
|
|
In the project properties, check where the output assembly (dll or exe) is going. Then look into that directory and verify the output assembly is there.
|
|
|
|
|
Hi!
Thanks for reply, i checked the project properties, the path is "bin\Release\" and in Release folder exe of projects is available.
one more thing i noticed that when i run the exe from Release folder it does not show output but it appears in Task Manager in Processes tab.
Tell me one more thing, does this happened without any reason or is it a bug in Visual Studio or some thing else? i dont understand why it happened, every thing was going fine and suddenly it stopped working...
Regards,
Affan Ahmad Toor
|
|
|
|
|
Affan Toor wrote: d that when i run the exe from Release folder it does not show output but it appears in Task Manager in Processes tab
That should be a clue: are you doing any kind of threading or something that would block the UI thread? Best way to continue here is set a breakpoint in your form's constructor and make sure everything goes as expected.
|
|
|
|
|
Hi!
Thanks for reply. Yes i am using a thread, but i dont think that thread is blocking the UI thread because i did not made any change in thread part, it is same as before.
Stil i have checked by setting breakpoint in form's constructor, as you suggested, but no clue! no error or exception and every thing went normally..
is it possible that solution file of my project is somehow corrupted?
Regards,
Affan Ahmad Toor
|
|
|
|
|
You could also try setting a breakpoint for the background thread. My bet is it's somehow blocking the UI from drawing.
Most helpful would be to post your code here.
|
|
|
|
|
Hi!
Thanks for reply, i have done all work again since last backup and now my project is running perfectly.
I still dont know what was the fault in previous code but i can not afford to figure out the problem due to time constraint...
It was very kind of you to help me. Thank you very much for all this help, i will be looking forward to get more help from you in future.
Regards,
Affan Ahmad Toor
|
|
|
|
|
What sort of project is it ? If you set breakpoints, is it running properly ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus!
Thank you for reply, it is a project related to mobile to PC communication. i am using GsmComm library for SMS and Phonebook managment.
It does not show any error or output even if i set break point, project is compiled and status bar shows "Ready" message, but no output is showed.
one more thing! i am also using thread, and i am starting it when startup page loads, previously it was also working perfectly.
Please suggest me what i am missing and what is the reason of this strange behaviour.
Thanks,
Regards,
Affan Ahmad Toor
|
|
|
|
|
So where do you expect to see output ? The program is running fine, right, just no output ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi!
Thanks for reply, the output must be displayed after program is compled successfully, just like normally happens.
yes you are rite, program is running fine but no output is generated. did i do something wrong? what is the reason behind this?
Regards,
Affan Ahmad Toor
|
|
|
|
|
If this has already been addressed, just point me in the right direction, please.
I'm trying to make an automatic wallpaper changer (using that user32.dll api that everyone uses, although there are differences among the parameters they choose). What I've done works fine on a PC at work, but it won't work on my Inspiron e1505. I understand it not wanting to display anything but a bitmap, but it didn't even want to display bitmaps on the laptop. Does it have to do with my Inspiron's odd-sized display or something (it's wider than normal displays)? Any ideas?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Can you post your code? We're otherwise in the dark.
|
|
|
|
|
I guess the modifications I did to it (while using a work PC... yeah, I know, but I wasn't on the clock) did the trick. Now it works just fine. I was saving images using myBitmap.Save(string filename) when I should have been using myBitmap.Save(string filename, ImageFormat.Bmp). I don't know why that would make a difference, but it did. It still doesn't answer the question of why it wasn't displaying images that were originally bitmaps, but, hey, it works now. Thanks anyway!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
hi
so my problem is already explained in the subject, i can't seem to be able to embed an icon in my application and then specify it as a shortcut icon for example for the user's desktop.
in fact the only way i found, to choose an icon for the shortcut is to add an .ico file to the main project but this is not good at all because i don't want users to be able to see a separate .ico file in my program insatllation folder.
i guess there's a trick to do it but i didn't find any help on that
thx in advance
C# is the future
|
|
|
|
|
no one knows how to do that !?
C# is the future
|
|
|
|
|
Hi,
I have a dictionary of Terrain objects in a game I'm working on. Here's the class that holds a single Terrain (I didn't include the properties for brevity, but they map directly to the fields):
<code>
public cass Terrain
{
private string name;
private string description;
private List<string> tiles;
private bool blocks = false;
public Terrain ()
{
this.tiles = new List<string> ();
}
}
</code>
Another quick question: would that class be a good candidate for a struct?
I have another class TerrainManager that has a Dictionary<string,Terrain> of these.
I did have code like this to create a terrain and add it to the TerrainManager:
<code>
Terrain terrain = new Terrain ()
terrain.Name = "Grass";
terrain.Description = "The green stuff.";
terrain.Tiles.Add ("grass");
terrains.Add ("grass", terrain);
</code>
That'd be fine if there were going to be just a few, but there will likely be hundreds. So I decided this might be a good excuse to learn a bit about XML. Also this way I don't have to recompile to make a change. Here's a sample of the XML format I decided upon:
<terrains>
<terrain key="grass">
<name>Grass</name>
<description>The green stuff.</description>
<tile>grass</tile>
</terrain>
<terrain key="tree">
<name>Tree</name>
<description>They're big.</description>
<tile>grass</tile>
<tile>tree</tile>
<blocks>true</blocks>
</terrain>
</terrains>
As you can see the <blocks> element is optional and there may be one or more <tile> elements. The key attribute in the <terrain> element is the key used in the dictionary.
I got it to work using XmlTextReader. So I guess I should be happy, but I'm not, because I'm not sure it'll handle all situations gracefully and the code is a bit hard to understand after a day after writing it.
This seems like a simple thing to do. I've read about Serializable objects and thought this might help me, but those tutorials only focus on writing XML from the objects, but I don't need to write XML. I only need to read it in once the program starts and fill the Dictionary<TKey,TValue> in my TerrainManager.
I just want to do this in the simplest way possible. I'm sorry if this post was long it's my first post here. Also I'd be happy to post the code I'm currently using the load the Xml. Thanks everybody, I've enjoyed reading the articles here since starting my journey in C# and .NET.
Also I should mention I'm using Mono on Linux, but I don't think that should matter too much.
--
Mark A. Nicolosi
|
|
|
|
|
Hi Mark.
I think the simplest way to do this would be to use XmlSerializer [^]class. Using this class, you just mark your class with the [Serializable] attribute, then when you want to save your object:
XmlSerializer serializer = new XmlSerializer(typeof(Terrain));
serializer.Serialize(someFileStream, myTerrainInstance);
And when you want to load a saved terrain object:
FileStream terrainFile = ...;
Terrain myTerrainInstaince = (Terrain)serializer.Deserialize(terrainFile);
|
|
|
|
|
I'm also a great fan of the XmlSerializer but according to a discussion I recently had in the XML forum it does not support the IDictionary interface. Therefore instances of the Dictionary though marked as Serializable cannot be used with the XmlSerializer .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Stefan Troschuetz wrote: it does not support the IDictionary interface
You're right, however, there are workarounds[^].
|
|
|
|
|
Thanks for the link. I'll bookmark that one
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|