|
thank you so much .....! I understood and tried it ! Worked perfectly ... !
|
|
|
|
|
Hi,
I have a startPrint method that sends a String to a printer to print, this method was called my many threads many time within a short period, and the following exceptions occurs,
System.ComponentModel.Win32Exception: The handle is invalid
at System.Drawing.Printing.StandardPrintController.OnEndPrint(PrintDocument document, PrintEventArgs e)
at System.Windows.Forms.PrintControllerWithStatusDialog.OnEndPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at VWServer.PrintObject.startPrint(String PrintingString, String PrinterName)
is there a way to fix this such that .NET is able to handle the large amoung of printing?
Thanks alot
|
|
|
|
|
Can I get rid of the class modifier 'S' in the following?
public class S {
public static string MyMethod( args ) { // foo }
}
public class C {
string s_answer;
s_answer = S.MyMethod( "bar" ); // how can I just write MyMethod()
}
Can I use a 'using' statement or some other directive?
Thx.
|
|
|
|
|
nyc_user wrote: Can I use a 'using' statement or some other directive?
No. In static methods you need to provide a class name where they belong to.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Unless, of course, you are calling it from within the same class the static is defined. (Sorry, I'm in a pedantic mood)
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Colin Angus Mackay wrote: you are calling it from within the same class the static is defined.
Or a nested class or an inherited class
|
|
|
|
|
Hi,
I would like to know an elegant way to correct smaller errors in a xml document when reading it f.e. when a tag is <Hellu> instead of <Hello> as it should be.
Thanks in advance
-- modified at 16:19 Saturday 25th February, 2006
|
|
|
|
|
im using like this
string hostadi = Dns.GetHostName();
label1.Text = "Host Name :" + hostadi;
IPHostEntry local = Dns.GetHostByName(hostadi);
foreach (IPAddress ipaddress in local.AddressList)
{
label2.Text = "IPAddress = " + ipaddress.ToString();
}
its working but
it found my network ip =192.168.1.15
how can i find my real ip
thanks for help;)
|
|
|
|
|
Then you have to use an external source. As you are behind a firewall or router, you can't see the external IP address unless you send something outside of your local net.
www.whatismyip.com[^] is one of the pages that will show your external ip address.
If your router has an adminitrator interface, you can see the external IP adress there.
---
b { font-weight: normal; }
|
|
|
|
|
What I have done in the past is write a webservice that I host somewhere outside my network, and have my application call it.
Once in the webservice, it's trivial to find the IP from the caller (your network IP as seen from outside of it).
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
|
There are so many articles on this site I have no idea what to exactly look for. Here's my scenario...
I need to read approx. 15,000 files in a program and do extensive calculations on each file. Running the job single threadded will take many hours. I was considering a multithreadding application. I thought one way to accomplish this was to run the program by processing something like 10 files at a time using threads.
How could I accomplish this? If you could tell me or point me to one of these hundreds of articles, I'd certainly appreciate it.
|
|
|
|
|
What you want is a ThreadPool . By default it handles up to 25 Threads for you, but you can change the number. But don't use too many threads at a time or the thread switiching overhead will be greater than the performance you might gain by using many threads.
Check this example over at MSDN.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you very much for the reply, and even more so for how quickly you did. I'll give this a shot.
|
|
|
|
|
You're welcome!
modified 12-Sep-18 21:01pm.
|
|
|
|
|
jakehn wrote: How could I accomplish this
If you are processing these files on a single cpu machine you can gain some performance at reading and writing these files.
Use three threads.
thread A - Continues reading files for buffer purposes.
thread B - Continues processing of files provided by thread A
thread C - Continues writing of files processed by thread B
If you have a multi cpu system at hand you could increase the number of processing threads to gain perfomance.
Backdraft
|
|
|
|
|
I want to create an application where is one Access database.
In this database there is table called customers.
I've made Crystal Report called CrystalReport1. When I start the program
it asks me for user name and password, server name and database name.
|
|
|
|
|
Can anybody give some ideas how to write a code for joystick coz i'm completely have no idea My supervisor asked me write a code for a joystick which can control the movements of a car. It must has a different level of accelerations to go forward and it also can turn left or right.He also mentioned that the best way to write the code is using c programme rather than assembly language,which i believe he's right and I'm using the 8051 microcontroller.
Thanks!
|
|
|
|
|
|
If you cannot get Windows and DirectX run on a 8051, C# is the wrong language for the problem.
CodeProject is about writing software for Windows, you have to ask somewhere else.
|
|
|
|
|
Hi. I'm a C# beginner and I am writing text to a file, but the reciever of the file wants it to be encoded in ISO/IEC 8859-1. I was earlier using System.IO.Streamwriter but I dont know how to do this with that class. Does anybody know hoe to do this in C#.Net
Robert
|
|
|
|
|
System.Text.Encoding.GetEncoding("iso-8859-1");
Check out the documentation for the Encoding class in the VS 2005 help.
|
|
|
|
|
I haven't done it myself yet, but you might try this:
StreamWriter text = new StreamWriter("test.txt", false, Encoding.GetEncoding("iso-8859-1"));
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yes, thanks. It's working now!
|
|
|
|
|
I have a windows application that I like to look a little more interesting. How would I go about applying a skin to it?
Thanks
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|