|
Hi folks,
I want to print out data to the screen in two aligned columns. For example the first column is from 0-20 and the second is from 30-50.
It's simple but I don't know how to implement that .
Any idea?
Thanks,
Tommy.
|
|
|
|
|
With my understanding of your requirement, I would suggest take the Datagrid and the specify the length of two column. I would also suggest that use percentage way to represent the size.
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
|
|
|
|
|
I wrote a small C# .NET program that has one form and one class (written by my boss) that opens a socket on a remote server. The socket class is able to open the socket and then the class fires an event back to the form when it does. This event calls a function within the Form1.cs class which makes an attempt to post output to a textbox on the form. It goes through the first few lines of code in Form1.Connect(...) but when it gets to the line mytextbox.AppendText("...") is jumps to a random line in the code of the socket class. For the life of me, I can't seem to get around this. I think it has something to do with the thread on which the event is executed and the thread that handles painting/appending text/etc. to the form. Any suggestions would be GREATLY appreciated.
|
|
|
|
|
Take a look at this article[^] on how to call UI thread objects from different threads.
This could be the reason for your problems.
Regards,
mav
|
|
|
|
|
Hello,
I'm trying to copy a treenode and all it's child nodes to the Clipboard.
So far all I can get to happen is to send the selected node text to the clipboard.
I was thinking that setting the clipboard data to whatever dataobject you sent in would send the entire thing over, but apparently not.
So for example I have this TreeNode:
+TheTreeNode
|--Child1
|+--Child2
|--Child2.1
|--Child2.2
|--Child3
What I want to do is click on TheTreeNode and copy that to the Clipboard.
When I paste somewhere, I 'd like to get the exact tree structure, or close to it as text.
I was thinking converting the node to xml then copying that to the clipboard, that seems like a long way around.
I'd appreciate any ideas or directions I could investigate.
Thanks, in advance!
--PhrankBooth
-- modified at 19:46 Thursday 29th September, 2005
|
|
|
|
|
For several days now I have been looking for some sample code showing how to read/write IPTC information from/to images. In particular I would like to be able to read the image description and keyword tags produced by Photoshop CS2. Please be so kind to point me into the right direction.
|
|
|
|
|
Try this : http://www.codeproject.com/bitmap/iptc.asp
|
|
|
|
|
How it is possible to load and read .gif, .jpg, .bmp, .png, .mpeg and other files can i open and read in my application divx files?
Is there a free loader dll or similar?
|
|
|
|
|
Hey guys,
This is the Ultimatum of a thread i post yesterday and is gone back in pages anyway. This was about .NET transparent code, and at first thought realised that .NET was not suitable for commercial software.
I JUST WANT YOU TO READ MY NEW POINT OF VIEW!!!
I have to tell you, i have been thinking and commercial software means you buy a software and that software is yours, 100% yours and that should mean that source code should be included to do whatever you want with it cause now it's your property.
But this doesn't apply to MS products, i haven't seen a bit of Windows src included rather than API methods calls in my apps. Anyway it's an example.
If we analyse it from the moral & etical point of view, it's right to include sources to commercial software. But users should be responsible from what they do with it. MS .NET provides an easy way of deployment for the people who wants to play with the sources.
So i'm glad the way .NET works and if any of you are going to develop a commercial app then copyright it and apply all the legal stuff to it. So if you find your software cracked or ilegally modified you can theorically apply legal penalties to the cracker or whatever you wan't to call the victim.
I didn't know that the fast and "secure" C++ native code could be disassembled and watch code the same way it was written, so any programming language can be disassembled, that means all the languages are at the same level but something i'm sure about is .NET rocks and is the way to go man!
Best regards,
Heinz
|
|
|
|
|
Heinz Suez wrote:
i have been thinking and commercial software means you buy a software and that software is yours, 100% yours and that should mean that source code should be included to do whatever you want with it cause now it's your property.
No, it's not. You bought a license to USE the software, not own it. The code is NOT yours. In most EULA's, you're expressly forbidden to reverse engineer the executable code to come up with anything resembling the source code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
I know it's not (i haven't a single commercial software that includes src and all EULA's as you said forbidden reverse engineer). But is my way to see it, opinions are allowed of course.
Thanx for opinion.
|
|
|
|
|
If you are making a customized software for a particular customer, it is alright to give him the source code. But, when you are launching it as a generalized product to a large number of people, disclosing source code may not be desirable and is not necessary as a legal requirement. Even as per the moral requirements, it is not necessary because what will a common or lay customer do with your source code? He is simply a user of the product and that too one of a large number of users. But, your rivals will definitely benefit. Of course, if your target group is the open-source, you may very well disclose your source code.
So, unless it is a customized software made for a particular customer only, a commercial application need not disclose source code. In today's cut-throat competition, it may not be advisable. So, disclosing source code of a commercial application may be injurous to your financial health.
Heinz Suez wrote:
But this doesn't apply to MS products, i haven't seen a bit of Windows src included rather than API methods calls in my apps.
In some cases, even MS is also disclosing its source code, e.g., in MFC classes. Even for the .NET classes, you can see the code of the relevant dll files of MS, using the same ILDASM as for your code.
Heinz Suez wrote:
So i'm glad the way .NET works and if any of you are going to develop a commercial app then copyright it and apply all the legal stuff to it. So if you find your software cracked or ilegally modified you can theorically apply legal penalties to the cracker or whatever you wan't to call the victim.
Legal processes are lengthy and costly. You may not be able to enforce your rights. Moreover, in an international scenario, enforcing legal copyrights becomes very difficult or almost impossible. Even a big corporation like MS has to live with a high level of piracy as the legal processes are not always productive or feasible.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Thanx for your comments, i agree in all you said. I'm developing a commercial app for a huge crowd, and i have got competition and people who hates me so i asume that there will be a cracked version or something that smells around the net only to take me down. But it's part of the normal process, as you said MS has to deal with that i'll have to deal with it too but it's going to hurt more.
Thanx for your help and lets face the reality.
|
|
|
|
|
Hi!
If I have a class with a certain number of properties, which I want to save to an XML file, where it is critical that the data can be read back into the variables as fast as possible.
My idea is to create an XmlTextReader and then read the values as follows:
while (reader.Read()) {<br />
if (reader.NodeType == XmlNodeType.Element) {<br />
switch (reader.LocalName) {<br />
case "Prop1": m_Prop1 = reader.ReadString();<br />
break;<br />
case "Prop2": m_Prop2 = reader.ReadString();<br />
break;<br />
case "Prop3": m_Prop3 = reader.ReadString();<br />
break;<br />
case "Prop4": m_Prop4 = reader.ReadString();<br />
break;<br />
case "Prop5": m_Prop5 = reader.ReadString();<br />
break;<br />
case "Prop6": m_Prop6 = reader.ReadString();<br />
break;<br />
default:<br />
break;<br />
}<br />
}<br />
}
I just want to make sure that I am in fact using the fastes possible way. So can anyone think of anything faster?
Thanks already in advance!
|
|
|
|
|
Why not just use XML serialization to write the instance to XML (assuming you're able to serialize everything you need to get using XML serialization)?
Example (assuming you wanted to save the XML file to disk):
string path = @"C:\MyClassInstance.xml";
XmlSerializer serializer = new XmlSerializer(typeof(MyClass));
using(StreamWriter writer = new StreamWriter(path, false))
{
serializer.Serialize(writer, myInstance);
writer.Close();
}
MyClass instance = null;
string path = @"C:\MyClassInstance.xml";
if(File.Exists(path))
{
XmlSerializer serializer = new XmlSerializer(typeof(MyClass));
using(StreamReader reader = new StreamReader(path))
{
info = serializer.Deserialize(reader) as MyClass;
reader.Close();
}
}
That should be pretty fast...
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Normally that would be an idea, however I don't have to serialize all of my class' properties. Those that need not be serialized are actually created from the serialized ones. So XmlSerializer is unfortunately out of the question for me.
|
|
|
|
|
Why do you say that using XML serialization would be out of the question just because you have some properties you might not want to serialize?
If you have properties you want to hide during serialization, then just mark them with the XmlIgnoreAttribute .
There are obvious advantages to using XML serialization besides the fact that it's probably faster than rolling your own solution. It's vastly more tolerant of changes to structure of the class being serialized, and almost impossible to accidentally create malformed XML.
Here's an example - enjoy...:
using System;
using System.IO;
using System.Xml.Serialization;
namespace XmlSerializationExample
{
class Example
{
[STAThread]
static void Main(string[] args)
{
MyClass mc = new MyClass();
mc.Property1 = "a";
mc.Property2 = "b";
mc.Property3 = "c";
mc.PickANumber = 1234;
mc.IgnoreThisProperty = "Blahblahblahblah.";
mc.Save(@"c:\serialized_myclass.xml");
MyClass mc2 = MyClass.Load(@"c:\serialized_myclass.xml");
Console.WriteLine("Deserialized Property1: {0}", mc2.Property1);
Console.WriteLine("Deserialized Property2: {0}", mc2.Property2);
Console.WriteLine("Deserialized Property3: {0}", mc2.Property3);
Console.WriteLine("Deserialized PickANumber: {0}", mc2.PickANumber);
Console.WriteLine("Deserialized ComboProperty: {0}", mc2.ComboProperty);
Console.WriteLine("Deserialized IgnoreThisProperty: {0}", mc2.IgnoreThisProperty);
Console.ReadLine();
}
}
public class MyClass
{
#region Fields
private string _field1;
private string _field2;
private string _field3;
private string _ignoredField;
public int PickANumber;
#endregion Fields
#region Constructor
public MyClass(){}
#endregion Constructor
#region Properties
public string Property1
{
get{return _field1;}
set{_field1 = value;}
}
public string Property2
{
get{return _field2;}
set{_field2 = value;}
}
public string Property3
{
get{return _field3;}
set{_field3 = value;}
}
[XmlIgnore]
public string IgnoreThisProperty
{
get{return _ignoredField;}
set{_ignoredField = value;}
}
public string ComboProperty
{
get{return string.Format("{0}{1}{2}", Property1, Property2, Property3);}
}
#endregion Properties
#region Methods
public void Save(string path)
{
XmlSerializer serializer = new XmlSerializer(typeof(MyClass));
using(StreamWriter writer = new StreamWriter(path, false))
{
serializer.Serialize(writer, this);
writer.Close();
}
}
public static MyClass Load(string path)
{
MyClass instance = null;
if(File.Exists(path))
{
XmlSerializer serializer = new XmlSerializer(typeof(MyClass));
using(StreamReader reader = new StreamReader(path))
{
instance = serializer.Deserialize(reader) as MyClass;
reader.Close();
}
}
return instance;
}
#endregion Methods
}
}
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Thanks, I didn't think of the XmlIgnore attribute. Just out of interest, if I added a property, would XmlSerializer still be able to read files that did not have that property yet?
|
|
|
|
|
The deserialization should ignore missing property values in the XML, although you might get into some trouble if you changed the type of an existing property to something that can't be coerced from the previous type (e.g. changing a string to a decimal or something), then tried to load previously serialized versions of the type.
Good luck.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
I don't think I'll ever have to change the type of a property, my only concern was newly added properties. Thanks for clearing this up for me!
|
|
|
|
|
Hello all coders!
I'm working with Updater Appication block with Enterprise Library and they work well but need to integrate Updater application into the Enterprise Library to see al topic togheter, I know i have to work with the code of Enterprise but no have idea how do that or even if is it possible. I'll glad any help, comments or link for information.
Thanks
David Alcaraz
|
|
|
|
|
Hallo...
I'm interested to write some Access Technology applications. Clearly it's only for study purpose. The problem is that I don't know where tu study this particolar problem. For example, some of my questions are:
1.How can I implement a DCM driver??
2.How does DCM driver (video intercept) work?
3.How can I access to TTS system? Ok, the speech SDK allows me to use the microsoft voice, but the other?
4.Which language should be used?
Can anyone explain me those things and how can I put them together?
I wrote in a C# forum because C# is my favourite language, but.... I don't know if I can use it for this particular situation... mmmh...
I know that this is very complex!
Thank you very much...
Comet
-- modified at 13:04 Thursday 29th September, 2005
|
|
|
|
|
I'm not familiar with DCM, but I will tell you that C# is a higher-level language. Writing things like device drivers ought to be left to languages that are closer to the metal, such as C or ASM.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
|
Yes, I know that I have to spend much time and I knew that c# maybe wouldn't be useful, but...
The major problem is documentation!
Where can I find docs on creating dcm drivers ad all other things...
Does anyone know some links (articles, discussions etc...) or books where to start from?
Before starting coding... documentation is needed...
Thanks
Comet.
|
|
|
|