|
NPow wrote: Well... System.Windows.Forms.VisualStyles is not a choice for me at the moment; The OS does not support them... I'm working on W2k and my control should work here too.
Windows 2000 doesn't support VisualStyles? The MSDN docs on VisualStyleRenderer says it's supported on 2k.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Judah Himango wrote: Windows 2000 doesn't support VisualStyles? The MSDN docs on VisualStyleRenderer says it's supported on 2k.
Where do you found that statement?
Direct from the MSDN 2, there stay:
[...]The VisualStyleRenderer class wraps the functionality of the visual styles (UxTheme) API from the Windows Shell portion of the Windows Platform SDK. For more information about visual styles, see "Using Windows XP Visual Styles" in the Platform SDK portion of the MSDN Library at http://msdn.microsoft.com/library.
Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003 Platform Note: Visual styles are supported only on these platforms.
[...]
All tests I have maid about it's support, deliver a false value or raised an InvalidOperation Exception!
Regards,
NPow
-- modified at 10:10 Thursday 20th July, 2006
|
|
|
|
|
Interesting -- the page you cite (http://msdn2.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstylerenderer.aspx) shows supported platforms as all of them, yet the documentation text says it's not supported on Win2k.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
i make windown application with c#
http://www.shoppinp.com/11.zip
i my pc run without probelm
but when i instul .Net 2.0 in other machin
i see this error
http://www.shoppinp.com/untitled.BMP
Palestine
|
|
|
|
|
TAREQ F ABUZUHRI wrote: http://www.shoppinp.com/11.zip
It runs fine on my machine.
You should try logging errors in the application to a log file. Use try/catch to catch errors. Also, in your Program.Main method, add a Application.ThreadException handler; this way you'll get forwarded the errors that occur in your program. You can then log them and see what's going on.
Another possibility is debugging. If you can attach a debugger to the the process that's erroring out on the other machines, you should be able to get a better idea what's going wrong.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi,
We are parsing csv file to XML document. It follows a structure. One part has changed.
<code>
<PRODUCTS>
<PRODUCT INVOICE="2" PRODID="1 No Lead" QTY="3000" />
<PRODUCT INVOICE="2" PRODID="3 Super" QTY="1000" />
<PRODUCT INVOICE="2" PRODID="4 Diesel" QTY="1000" />
</PRODUCTS>
</code>
In this case we need to add a
<PRODUCT INVOICE="2" PRODID="2 Plus" QTY="0" />
If a product doesn't exist need to add that name with qty 0. How would we go about doing this? We are adding this to PRODUCT node.
Thanks.
-- modified at 12:59 Wednesday 19th July, 2006
|
|
|
|
|
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
XmlNode productsNode = xmlDoc.ChildNodes[0].ChildNodes[0];
XmlElement productElem = xmlDoc.CreateElement("PRODUCT");
XmlAttribute invAttr = xmlDoc.CreateAttribute("INVOICE");
invAttr.Value = "2";
XmlAttribute prodidAttr = xmlDoc.CreateAttribute("PRODID");
prodidAttr.Value = "2";
XmlAttribute qtyAttr = xmlDoc.CreateAttribute("QTY");
qtyAttr.Value = "0";
productElem.Attributes.Append(invAttr);
productElem.Attributes.Append(prodidAttr);
productElem.Attributes.Append(qtyAttr);
productsNode.AppendChild(productElem);
|
|
|
|
|
Thanks for the reply.
Reading the values from a csv file, which has rows for the different product/fuel types. Sometimes there are 3 rows for Lead, Plus, super. so, want to add another line in XML document for diesel, with quantity 0. that way, there are alwasy 4 rows in the XML document.
|
|
|
|
|
Consider adding all four with value zero to each products node, then updating with values from the CSV file...
|
|
|
|
|
Hi all!
I need some solution, to do a "low level" logging for my application. In teh log, I want to see everything like function calls, strak trace, button events, textbox events.... like the profilers do.
Until now, I write my own loging system, and send messages to the logfile by hand like this:
Log.LoggThis("Something went ok",LogType.Message); or Log.LogThis("some error occured",exception,LogType.Error);
But I think is there a better vay to do this vithout hand coding in every method, and event handler....
If anybody have some idea, please wrote it to me.
Thanks, and sorry for my bad english.
|
|
|
|
|
|
Thank's I alredy know about NLog, and it's a good thing, but it's do the same, like my own loging engine.
Nlog write to file, what you want, but you must tell it, what, where, and when. So it isn't automatic, and still ned to write the logging messages into the code.
My solution has 3 projects, and a lot of forms, and classes witch have a tonn of functions, and events, so I don't want to write logging procedure for each method...
If you ever yuse some profiler, like Ants, or ReSharper yo see te way I like. These pograms need only the target application executable fle, and they listen into the app code, and tell you what happend in where, ad the target application don't need to modyfi.
-- modified at 16:59 Wednesday 19th July, 2006
|
|
|
|
|
I think you can solve this issue by using .NET Reflection. Take a look at this article (TraceListeners and Reflection)[^] - it contains enough to get you started.
In the example, the author of the article shows how to log information such as the calling function on the stack and the argument list of that function. He also explains how you retrieve information about the call stack.
Hope that helps!
Sincerely,
Alexander Wiseman
|
|
|
|
|
Tank's for the answer!
I try to use the refered article, to work out the correct solution.
-- modified at 3:37 Thursday 20th July, 2006
I checked the article, its good, but isn't do what I want. This type of logging stil need to be modyfy the target program.
I need solution to log a program/process without modifying it's code...
|
|
|
|
|
My progress bar in the status bar doesn't want to run.
The application I created is a SQL tool for an oracle db I work on. Basically, I just type my SQL code in a RichTextbox and then the data comes back in my datagrid. That works fine.
I thought it would be cool if I could add a progress bar and set it to marquee while I was waiting for my data to come back.
I'm pretty sure I need to multi-thread this beasty but when I do I get the following message: "Cross-thread operation not valid: Control 'rtbSQL' accessed from a thread other than the thread it was created on."
Here's what I passed to the new thread (which is created when I click the run button):
btnRunSQLClick(bla bla...)
{
Thread t1 = new Thread(new ThreadStart(GetData));
t1.Start();
}
the GetData() code:
public void GetData()
{
try
{
da=new OdbcDataAdapter(this.rtbSQL.Text, this.cnn);
cb=new OdbcCommandBuilder(da);
dt=new DataTable();
da.Fill(dt);
}
catch(OdbcException ex)
{
MessageBox.Show(ex.Message);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
this.dataGrid1.DataSource = dt;
}
Any ideas? I'm definitely a novice at threading!!
|
|
|
|
|
If you are using 2.0 you could use BackgroundWorker and subscribe to the OnProgressChanged event to update your progressbar.
Otherwise you need to use an event to update your progressbar in the UI thread or use invoke on the progressbar to update it.
Take a look on this site for some good examples of multi-threading
|
|
|
|
|
The problem is the following line: da=new OdbcDataAdapter(this.rtbSQL.Text, this.cnn); . As the error message says accessing a control a thread other than the thread it was created on isn't allowed.
You should retrieve the value of the this.rtbSQL.Text property before starting the worker thread and then pass it to the method. Therefor you could either use this overload of the Thread.Start method[^] or follow techniques presented in this MSDN article[^].
"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
|
|
|
|
|
I want to read a very large files such az log files in IIS line by line with an especial format for each line (by c#),Which way or function do you recommand?
-- modified at 11:37 Wednesday 19th July, 2006
|
|
|
|
|
StreamReader reader = new StreamReader("MyFile");<br />
string strLine;<br />
<br />
while( (strLine = reader.ReadLine() ) != null )<br />
{<br />
}
|
|
|
|
|
tail ?
(download cygwin)
or perhaps
// warning, pseudo-code, if it doesn't compile => fix the code yourself
static void Main(string[] args)
{
string line;
using(StreamReader sr = new StreamReader(args[0]))
while((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
Console.ReadLine();
}
}
|
|
|
|
|
Hello
first of all thanks for answer,So Fast!
Look
the problem is that these are huge file,Maybe 1G...
The solution that you recommanded ,have problem of speed,I want a solution that read file faster.
Thanks in advance
|
|
|
|
|
It is two parts, one you have to use a stream with a file so big because you do not have the memory to do otherwise. Secondly, if the file is not indexed your SOL. If it is indexed you can use any traversal algorithm to get the data you need. ( I did this technique with the national do not call list and it works fairly fast)
Also, you may consider c++ if you just need speed.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: Also, you may consider c++ if you just need speed.
I'm not sure how much that would help though. The filesystem would still be the bottleneck in performance.
|
|
|
|
|
You can use memory mapping in C++ which will reduce the bottle neck for speed.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
what is it you want to do?
the question was: "I want to read a very large files"
I told you how to read without memory problem.
Now it can't read faster than you!
Had the question be: "I am looking for a particular pattern" I might have added an automated search function.....
But if you want to read it all, you've got to do it man!
|
|
|
|