|
Steve Harp wrote: As I said, this is a suite of applications that work together. That's why the log is shared. It allows end users to provide information to technical support about when and where whatever happened.
Then I can only repeat what I said - it isn't a good idea to share the same file.
I base that on 20 years of using logs.
|
|
|
|
|
Hi Steve,
I'm afraid I'm missing something here. Yes, when an application creates a text file it can control the permissions of the file, just as the administrative-privelege application does. That application would need to create the log file with different priveleges allowing "world" read/write access.
If that's not possible, an administrative user could change the permissions of the file after it is created, but that an operational issue rather than a programming issue.
BDF
I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be.
-- BillWoodruff
|
|
|
|
|
|
Excellent! That put me on the path.
Thanks very much....
|
|
|
|
|
Hi All
This has been drving me insane. I have a user control that I am adding and removing controls from and want to see what it looks like on the main form. When I goto the main form the updates are not there. The same thing happens when I run the solution. Taking the control off and putting it on again doesn't work. Shutting down visual studio 2008 and re-opening it causes me to loose all of my changes. I found this article here[^] but it didn't fix my problem. I even deleted all copies of the dll I could find, checked the auto populate setting and when I went to the Choose Items... dialog, there was a reference to the dll in there as before.
The form and user control are in the same DLL within the solution. Is there any way around it? Should I structure my project differently?
Thanks for your help in advance
The FoZ
|
|
|
|
|
A bit harsh, but this should do the trick;
- Right-click on the toolbox, and choose "Reset Toolbox".
- Right-click on the toolbox, and choose "Choose Items.."
- Select "browse" to navigate to the assembly containing the UserControl.
Bastard Programmer from Hell
|
|
|
|
|
Closing Visual Studio and losing your changes without a prompt is really strange. I think Visual Studio is corrupt.
Does it update if you close the user control and main window, then build and reopen the main window?
If so go with that.
"You get that on the big jobs."
|
|
|
|
|
That seems to be working thanks. Although I'm not sure if the Easter Break has done my PC some good.
I'll make sure everything is update to. Hopefully my 2010 installation is causing any troubles.
Cheers
The FoZ
|
|
|
|
|
I’m using Visual Studio 2010 on Windows 7
I’m trying to write a log file in one program while reading the same log file in a second program.
The first program receives data from a server every minute from second 0 through second 5.
I want the second program to sleep till 30 seconds after each minute, read the traces from the first program’s log file, and display any warnings.
I found a post on the web saying I should open the file in program 1 as:
_logStream = new FileStream(logFileName, FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
_logFile = new StreamWriter(_logStream);
Then open the file in program 2 as:
var _logStream = new FileStream(filename1, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var xyz = new StreamReader(_logStream);
But I get the error message:
Unhandled Exception: System.IO.IOException: The process cannot access the file '
C:\SandBox\120405133716.log' because it is being used by another process.
Can this be done in Window's 7 ??
If so, what is the proper code ??
|
|
|
|
|
I don't like textfiles as a buffer. I'd switch to a database, and do insert's and selects - that would also solve the problem of simultaneous access.
Bastard Programmer from Hell
|
|
|
|
|
|
No. The only code you're going to get is the code you write.
We're not in the business of handing projects out to everyone who demands them. We're in the business of helping you with your own code.
|
|
|
|
|
Dave Kreskowiak wrote: No. The only code you're going to get is the code you write.
Perhaps Chris should rename the site, The Codes Project.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
or perhaps the CODEZZZ URGNNTZZZ!!!! PROJECT
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Quote: codes for the note pad
Is that supposed to mean something?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
1. Press the windows key + R.
2. In the dialog that appeared, type in the code "notepad" (without quotes)
Notepad launches.
V.
|
|
|
|
|
Notepad is basically a TextBox. Create a form, add a TextBox and menu items to load/save text, and you essentially have NotePad.
"Microsoft -- Adding unnecessary complexity to your work since 1987!"
|
|
|
|
|
Hi
I have application that is define as MDI,
there are several form child
once the user press X button, i wish the application to be close and all other windows.
at the FromClosing event i add the following code
//handle and close the logic layer...
foreach (Form frm in this.MdiChildren)
{
frm.Close();
frm.Dispose();
}
Application.Exit();
All childs are closed but the the event FromClosing
happen agian, why?
i would expect the event of the main form FromClosing will happen only one time.
this cause my problems at the logic layer
ronen
|
|
|
|
|
Ronenb wrote: All childs are closed but the the event FromClosing
happen agian, why?
Because you called "Application.Exit", which will close all the forms and exit the application. You needn't close all forms manually, exiting the application should be enough and should close all remaining forms (and dispose them) automagically.
Bastard Programmer from Hell
|
|
|
|
|
in case i will remove closing the child manully, once i click close "X", each time child window will be closed
i need to press X button accurding the number of child windows that are opend
what am i'm missing?
what is the correct process to close MDI application?
thanks
ronen
|
|
|
|
|
There are TWO X-es on a MDI-form if you have the children maximized. If you want to close the application, you close the mainform. That's how things work in Windows, and across all other MDI-applications. If you close one of the child-windows by using it's X, then you are merely closing that particular document of the "Multiple Document Interface".
Likewise, Ctrl-F4 would close a child-document, Alt-F4 would close the application.
Ronenb wrote: what is the correct process to close MDI application?
Application.Exit from code, the X topright of the mainform or Alt-F4 from user-input.
Bastard Programmer from Hell
|
|
|
|
|
i'm trying to closing the app by the mainform X , not the child form X
the status is when i press the mainform X, a child win is closed, each click close child form till all childs are closed, last click on X close the app once no child exist
any advice?
|
|
|
|
|
Ronenb wrote: any advice?
Yes. Post the code from the children's OnCloseForm handler.
Start a new project, add this code;
namespace WindowsFormsApplication15
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.IsMdiContainer = true;
new Form() { MdiParent = this, Visible = true };
new Form() { MdiParent = this, Visible = true };
}
}
} That'll display two documents within a MDI-parent. App will close on X, unless you have some custom code somewhere.
Bastard Programmer from Hell
|
|
|
|
|
Do any of the child forms have FormClosing(..) handlers? If so check them to see if they might be doing anything that's interfering, such as setting e.Cancel to true.
You might also try stepping through the main form's closing handler with the debugger if you haven't done that already.
BDF
I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be.
-- BillWoodruff
|
|
|
|
|
i am using three tables and i want ot bind that tables to the treeview control so please suggest me with an example
|
|
|
|