|
What exactly are you trying to do when this happens and is that all the message says? "WSACancelBlockingCall"? Or does it say something like: "A blocking operation was interrupted by a call to WSACancelBlockingCall"?
|
|
|
|
|
This is the answer that i´ve got. I´m working with threads.
|
|
|
|
|
Dear Friends
I migrated my project to .net 2005 which was in .net 2003(windows application using C# language)
When I run the solution the forms and the controls are as if it is still in .net2003
then I opened the files(all) and changed the versions from 1.0,1.3,etc to 2.0
till then I did not got the .net 2005 control appearance.
What should I do.
Please reply soon...
My mail Id is rabindrapatra@gmail.com
Thanks
Rabindra Patra
|
|
|
|
|
I guess you're looking for the Application.EnableVisualStyles method:
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}
"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 used "Application.EnableVisualStyles();" and is working fine
Thanks for the quick reply.
Rabindra
|
|
|
|
|
How do you make a button the default button in a Windows form?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Set it's DialogResult property to OK. To really do the job, set the 'AcceptButton' property of the form to that button as well.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I´m working with Sql Server 2000 and C# Framework 1.1. I would like to create a nested transaction that is I would like the option to the following:
_ i ´ve got an object x with a subset of object y. How can i create a nested transaction? when i storing the objects i would like to have the possibilisty to store the objects x in the DB but i´ve got an exception while storing y i would like to have the possibility of rollback. That is:
Transaction X begin
Transaction Y begin
Transacation Y rollback --> Only rollback Y not X
Transaction X commit --> Commit X
|
|
|
|
|
Hello,
By default, if you click the header of the DataGridView control, it sorts that column. Is there a way to disable that?
Thank you.
|
|
|
|
|
Each column within the DataGridView has a SortMode property which you can alter to change the default behaviour.
|
|
|
|
|
Project Properties - Build - Advanced
in this dialogbox you can change the dll base address, but that ain't working for me, i always get the error DISP_E_BADVARTYPE. How come?
Am i entering an invalid number? Can someone help me out here?
thx
|
|
|
|
|
The Base Address must be a multiple of 64K (65536 decimal), cannot be lower than 64K * 256 and cannot be higher than 64K * 32768.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
One of the rare cases where the number 42 won't do.
---
b { font-weight: normal; }
|
|
|
|
|
Big thx, i would give each assembly a fixed address, but how do i know how much space i have to leave between the addresses given to 2 different dll's?
|
|
|
|
|
You don't really. Not without some work in the debugger to figure out what your resulting code size is anyway.
Why do you think you need to do this anyway? The only real benefit is to speed up loading assemblies, but only slightly. All you're doing is (trying to) save the loader from having to calculate a starting address for you.
This can also introduce unexpected problems. If an assembly won't fit in a hole that exists at the address you specify, or if the address is already being used by another assembly, then you actually increase the time it takes to load the assembly as the loader has to calculate a new address.
-- modified at 12:05 Saturday 19th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
yep that is why i'm using it, to speed up the time of loading. But i'm just testing it out, now i saw it makes almost no difference.
I also read by using NGEN, u can precompile your assemblies to use, does that help the speed of loading the application?
I'm using an installer for install my project on client pc. So then i have to add a function to execute NGEN in a custom action in my installer?
|
|
|
|
|
Timothy_1982 wrote: to speed up the time of loading. But i'm just testing it out, now i saw it makes almost no difference.
Yeah, it doesn't take that long to calculate a new load address...unless you've got LOTS of .DLL's being loaded.
Timothy_1982 wrote: by using NGEN, u can precompile your assemblies to use, does that help the speed of loading the application?
Yes it does. Probably not as much as you're hoping though. Alot of the overhead you see launching a .NET application is the startup of the Framework itself. There's just about nothing you can do about that.
Timothy_1982 wrote: I'm using an installer for install my project on client pc. So then i have to add a function to execute NGEN in a custom action in my installer?
That's typically how it's done. Since NGEN produces binaries that are VERY processor specific, you can't just NGEN yourself a precompiled app and distribute that to everyone. Best practice is to include the NGEN step in the customer install and NGEN the application assemblies as the last step in your installation, using a custom action.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thx for all the answers, clear and usefull.
|
|
|
|
|
I'm trying to read a text file that just happens to be a log file for a service, and getting the following error.
"System.IO.IOException: The process cannot access the file 'D:\SomeFolder\Logs\Funsv.log' because it is being used by another process."
The exception makes it very clear what the problem is, but I can't find any options in StreamReader that allow me read-only access to a file, even when it's being used by another process. Does anyone know how this can be done?
-- modified at 8:02 Friday 18th August, 2006
|
|
|
|
|
If the process that has the file open for write is using DenyShareRead or DennyShareAll to open it, then you can't open it for reading at all until the service closes the file.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Ouch. In that scenario, would it be possible to read the file using WinAPI?
|
|
|
|
|
Matt Casto wrote: would it be possible to read the file using WinAPI?
No, because it's the Win API that is underlying the Stream classes.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I solved this problem by using a FileStream instead of a StreamReader. The constructor of the FileStream allows you to set FileAccess and FileShare which avoids the access problems. The FileStream doesn't allow you to read line-by-line nicely, but I happen to have a class that I re-use often which acts like a TextReader but uses a FileStream in the background.
|
|
|
|
|
You can wrap the FileStream in a StreamReader object like this:
FileStream fs = New FileStream("filepath", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader sr = New StreamReader(fs);
You'll then have all the advantages of the StreamReader, with the access flexibility of the FileStream.
-- modified at 17:47 Friday 18th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I write a client server network program, the client part
using HttpWebRequest to access the server. The server part uses
threading and sockets list to listen the client request.
The program worked fine in .NET1.0 and after I upgraded to VS2005 (NET2.0)
the program didn't work, with the error in client side as "unable to write data to the transport connection, connection closed by program in host".
The strange part is that the error come out in the second access from the
client to the server. The first access to server is OK, but the second access can't connect to the server and generated the error.
I suspect that this may be due to NET2.0 upgrade, but don't know the exact problem. Anyone can help ?
Part of the client code is as below,
try
{
WebRequest request = HttpWebRequest.Create(remoteClientSession.URL);
string contentType = "multipart/form-data;";
request.ContentLength = message.Length;
request.Method = "POST";
request.Timeout = timeoutTime;
Stream requestStream = request.GetRequestStream();
requestStream.Write(message, 0, message.Length); ** error start to throw here
requestStream.Close();
}
catch (WebException webEx)
{
}
catch (IOException ex)
{
** the error throw in here "Unable to write data to the transport connection"
}
WebResponse response = request.GetResponse();
.....
Thanks
|
|
|
|