|
hmmmm ya know i never thought of trying that!
I always assumed it had to be a field that was being passed through.
|
|
|
|
|
From the language specification:
When a formal parameter is an output parameter, the corresponding argument in a method invocation must consist of the keyword out followed by a variable-reference (§5.3.3) of the same type as the formal parameter.
|
|
|
|
|
Makes sense technically, but it's poor detail hiding.
I suppose "fixing" it would cause a performance hit.
|
|
|
|
|
Join the club, line forms to the right. I was in the same place about a year ago and had to choose between reflection games and using public variables. In retrospect I think the latter would've ended up sucking less.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Now that you've mentioned it, I have an irrational need for indexers to be passed as an out parameter. Gahhhhhh.
|
|
|
|
|
I am having a problem with a File Stream. I am using the following code:
//Get .RJB file
m_oZipFile = new ZipFile(new FileStream(l_szLocation, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite));
I hold onto the m_oZipFile until I close the XML editor (that I am building), I am closing the Stream as follows.
m_oZipFile.Close();
When I close the program I am not getting the File write access back. For example, if I have 2 of the XML editors open, once I close the one with Write access to the file, the other one does not gain the write access.
|
|
|
|
|
I have also tried doing the following:
m_oFileStreamTest = new FileStream(l_szLocation, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
m_oZipFile = new ZipFile(m_oFileStreamTest);
then to close
m_oZipFile.Close();
m_oFileStreamTest.Close();
m_oFileStreamTest = null;
m_oZipFile = null;
|
|
|
|
|
Hi,
you most close things in reverse order from opening them.
|
|
|
|
|
Is that not what I have done?
|
|
|
|
|
|
I have close things in the reverse order and i still get the same error. That being that write access is not given to the next open file.
|
|
|
|
|
These are some of the questions that need answered in order to debug:
What is ZipFile ?
if your class, show code; at the least the constructor, the Close method and any methods they may call. Provide proof that Close run up to its end.
if ZipFile is not your class, where did you get it ?
Does the problem exist outside your app:
- can you rename the file with Windows Explorer ?
- Can you delete the file ?
Try another file name. Does it work the first time ? and the second time ?
Any chance your previous EXE is still running (e.g. because one of the threads
is still running while not declared a background thread) ?
Any chance your app has another stream open on the same file ?
Why do you use FileMode.Open instead of Create ??
And why FileAccess.ReadWrite ? are you first reading then writing (hence
multiple streams...) ?? if so did you close all streams before closing the file ?
And why FileShare.ReadWrite ???? I must strongly advice against it. If you do
not absolutely need this, use None !
|
|
|
|
|
I think what Luc is trying to say is that you need to close the m_oFileStreamTest before closing the m_oZipFile .
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
You might want to try wrapping things in a using statement to ensure that the streams are being closed properly. It should look something like this:
using (FileStream m_oFileStreamTest = new FileStream(l_szLocation, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
{
using (ZipFile m_oZipFile = new ZipFile(m_oFileStreamTest))
{
}
}
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
I have a central database in a server computer(In sql express 2005).
Two or more computers can connect to the central database.When a terminal computer is doing some operation on some data, how can i ensure that the other terminal
in the same network doesnot change the data at the very same moment?
Help appreciated both in C# or VB.Net
X
|
|
|
|
|
|
I have read a demo about the Slide puzzle game.
http://www.codeproject.com/csharp/slidingpuzzle.asp[^]
It's great. But i need to know more. I would like to cut the image to any sharp, such as circle, wheel... not only square.
How can i do that?
More, how can i cut the image to several pieces with any sharp and then collect and join them into the original image by drag and drop them(a game call juzzle)?
Thanks in advance
Phong Tran
-- modified at 10:50 Friday 22nd June, 2007
JohnJone
|
|
|
|
|
I want to read entire data in particular table into my variables.that can be an array. In sametime I want to sort those value. I u know some thing about this pls reply me. That is so urgent, pls.... pls....
|
|
|
|
|
kaushal654 wrote: That is so urgent
Is it... There are so many people that say that their problem is urgent that I remain unconvinced.
kaushal654 wrote: I want to read entire data in particular table into my variables.
What do you mean by that. What variables? What type of object are they?
kaushal654 wrote: In sametime I want to sort those value.
How would you like them sorted?
So, what work have you done so far in this urgent matter? Why not show us your code and we can help you fix it up.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
kaushal654 wrote: That is so urgent, pls.... pls....
It's been over an hour since I requested that you clarify your question. It is genuinely was urgent you would have replied by now. So, I can only conclude that putting urgent in the message was a deception.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
It obviously wasn't so urgent that he had to solve it before knocking off for the weekend.
|
|
|
|
|
I would not be surprised to see same post on monday!
Again very URGENT, of course!
|
|
|
|
|
No, by Monday it would be very, very urgent;P
only two letters away from being an asset
|
|
|
|
|
By that stage I expect it to be "Oh my god - we're doomed"!!!
|
|
|
|
|
Pete O`Hanlon wrote: By that stage I expect it to be "Oh my god - we're doomed"!!!
I just had the voice of Fraser from Dad's Army in my head when I read that.
Wuhrr doomed. Wuhrrr alllll doooommmmmmmed!
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|