|
Good point.
We "use" Microsoft HTML Help Workshop 1.3 - it's old, and it's not good to use. (And we hardly ever use it, our help files are really outdated).
At a different company, the documentation guys used RoboHelp. It allowed for better help integration than the HTML Workshop, you could generate context-sensitive help downto the controls on a form. But I do not know how hard it is to use.
|
|
|
|
|
These days I just create HTML pages and have the F1 link point a browser at it. The classic .hlp type help is no longer supported under recent Windows, and .chm help is just HTML but annoying to use.
|
|
|
|
|
My project was created in winxp and now migrated to windows7. I am getting a weird exception while click on the openfiledialog icon in my project and the application crashes after this. This only happens when I create a release build and install that build in windows 7.
The setup is also created in the windows 7. I do no get this exception when run the code in the debug mode.
I am setting the initialdirectory property of the openfiledialog to desktopdirectory.
Below is the exception trace i caught in the windows event viewer.
Application: projectname.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at System.Windows.Forms.UnsafeNativeMethods.GetOpenFileName(OPENFILENAME_I)
at System.Windows.Forms.OpenFileDialog.RunFileDialog(OPENFILENAME_I)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPtr)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr)
at System.Windows.Forms.CommonDialog.ShowDialog(System.Windows.Forms.IWin32Window)
at System.Windows.Forms.CommonDialog.ShowDialog()
at companyname.projectname.MainForm.processFileOperation(FileOperationType)
at companyname.projectname.MainForm.fileOpenMenuItem_Click(System.Object, System.EventArgs)
at companyname.projectname.MainForm.toolBar_ButtonClick(System.Object, System.Windows.Forms.ToolBarButtonClickEventArgs)
at System.Windows.Forms.ToolBar.OnButtonClick(System.Windows.Forms.ToolBarButtonClickEventArgs)
at System.Windows.Forms.ToolBar.WmReflectCommand(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ToolBar.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef, Int32, IntPtr, IntPtr)
at System.Windows.Forms.Control.SendMessage(Int32, IntPtr, IntPtr)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr, System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WmCommand(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.DefWndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message ByRef, System.Windows.Forms.MouseButtons, Int32)
at System.Windows.Forms.Control.WndProc
(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ToolBar.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
at System.Windows.Forms.Application
+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
at companyname.projectname.MainForm.Main(System.String[])
|
|
|
|
|
This is not caused by a building a release-mode or creatng a setup on Windows 7. First, you'll need to implement an event[^] to deal with "unhandled exceptions". Next, you'd need to debug to find out the cause of the exception; my guess is that the filename or the path is mukking up things.
Can you post the code that calls your dialog? And the filename/path that you select? And the initial directory you try to set?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
<pre lang="c#">OpenFileDialog dlg = new OpenFileDialog();
#endregion
#region DIALOG BOX SETTINGS
string previousOpenFilePath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
dlg.RestoreDirectory = true;
dlg.DefaultExt = ".xml";
dlg.Filter = "XML Document (*.xml)|*.xml|Excel File (*.xls)|*.xls|Excel File (*.xlsx)|*.xlsx|VPI File (*.vpi)|*.vpi|All Files (*.*)|*.*";
#endregion
dlg.CheckPathExists = true;
dlg.CheckFileExists = true;
if (dlg.ShowDialog() == DialogResult.OK)
Here the exception comes at the showdialog call. The stacktrace goes in eventviewer.
|
|
|
|
|
Looks good
..and how does the filename/initial path look like?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello!
I created a process containing a NamedPipeServerStream and second process NamedPipeClientStream.
I managed to establish communication between both processes on the same server. Is also worked on two different computers over the network, after I created the same USER and Password on both computers.
But it only worked, if after i assigend the group "Administartors" to the users. Is it possible to establish connection between without beeing Administrator?
My first Try:
NamedPipeServerStream m_PipeServerStream = new NamedPipeServerStream(
Properties.Settings.Default.PIPE_NAME
, PipeDirection.InOut
, SERVER_THREADS
, PipeTransmissionMode.Byte
, PipeOptions.Asynchronous
, BUFFER_SIZE_kB
, BUFFER_SIZE_kB);
if (Properties.Settings.Default.SERVER_USER.Count > 0)
{
foreach (string item in Properties.Settings.Default.SERVER_USER)
{
m_PipeServerStream.GetAccessControl().AddAccessRule(new PipeAccessRule(
item
, PipeAccessRights.ReadWrite
, System.Security.AccessControl.AccessControlType.Allow));
}
}
|
|
|
|
|
True_Posi wrote: Is it possible to establish connection between without beeing Administrator?
It is according to the docs[^]; take a look at the end of the page, the section called "community content".
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
According to docs you linked, i added the following code to my Server:
PipeAuditRule auditRule = new PipeAuditRule("Everyone", PipeAccessRights.FullControl, AuditFlags.Failure);
PipeAccessRule accessRule = new PipeAccessRule("Everyone", PipeAccessRights.FullControl, AccessControlType.Allow);
m_PipeServerStream.GetAccessControl().AddAuditRule(auditRule);
m_PipeServerStream.GetAccessControl().AddAccessRule(accessRule);
But the user must still be an "Administrator".
The Server application runs on a Windows Server 2008 R2 and the client on Windows 7.
|
|
|
|
|
Did you get an exception? I'm wondering whether it's that particular code that requires admin-permission; does the bare-bones example ask for the same permissions?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I think it simply does not connect (as far as i found out).
I also tried it with an AccessRole of a usergroup, i created only for users of my server. it does not work.
Code from the Server thread (As it works as with absolutely equal user accounts):
private void NMP_ServerThread()
{
int threadId = Thread.CurrentThread.ManagedThreadId;
try
{
NamedPipeServerStream m_PipeServerStream = new NamedPipeServerStream(
Properties.Settings.Default.PIPE_NAME
, PipeDirection.InOut
, SERVER_THREADS
, PipeTransmissionMode.Byte
, PipeOptions.Asynchronous
, BUFFER_SIZE_kB
, BUFFER_SIZE_kB);
Console.WriteLine(string.Format("SERVER: Thread {0} :Waiting for child process connection...", threadId));
pipeServerInstancePool.Add(threadId, m_PipeServerStream);
this.State = ServerState.Started;
pipeServerInstancePool[threadId].WaitForConnection();
if (pipeServerInstancePool[threadId].IsConnected)
{
NMPEventArgs args = new NMPEventArgs();
args.State = ClientState.Conneceted;
RaiseOnClientSateChanged(this, args);
while (State == ServerState.Started && pipeServerInstancePool[threadId].IsConnected)
{
StartAsyncReceive(threadId);
}
}
}
catch (ObjectDisposedException)
{
this.State = ServerState.Closed;
}
catch (IOException)
{
this.State = ServerState.Closed;
}
RaiseOnClientThreadFinished(this, new ClientThreadFinishedArgs(threadId));
}
Client Thread:
private void NMP_ClientThread()
{
pipeClient = new NamedPipeClientStream(
Properties.Settings.Default.PIPE_SERVER
, Properties.Settings.Default.PIPE_NAME
,PipeDirection.InOut
,PipeOptions.Asynchronous
,TokenImpersonationLevel.Impersonation);
try
{
try
{
pipeClient.Connect();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
if (pipeClient.IsConnected)
{
RaiseOnStateChanged(this, new StateChangedEventArgs(ClientState.CONNECTED));
}
while (stopClient == false && pipeClient.IsConnected == true)
{
StartAsyncReceive();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
RaiseOnConnectionLost(this, new EventArgs());
}
|
|
|
|
|
Hi all!
I've got a problem with a where clause in a subcollection, the situation is like this.
I've got a collection of schools, in that collection there's an other collection of students. I want to perform a where clause in de student collection.
So, its like this:
List<schools>
- Id: Guid
- Name: string
- Address: string
- Director: string
- List<students> (- Id: Guid, - Age: int, - Address: string, - Study: string)
I want to do something like this (which doesn't work... ), so I only pass all the schools with all the students who study IT.
CheckStudents(School.Where(s => s.Students.Where(s => s.Study == "IT")))
The method signature CheckStudents looks like this: CheckStudents(List<schools>)
Can anyone help me out on this?
Thanks in advance!
|
|
|
|
|
Are your collections actual .Net classes or are they themselves just lists ? It is not clear the way you have structured your question.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Off the top of my head, you should be able to use the Any clause in place of the inner Where , and you need to apply .ToList() at the end to convert it from a query into a concrete collectino.
|
|
|
|
|
Query methods are only for selecting or creating objects, not modifying them. So you can't pass school objects with the student list modified to only contain students studying IT, unless you create a new School.
I think you want CheckStudents to take the list of schools and the subject:
void CheckStudents(IEnumerable<School> schools, string subject){
foreach(School school in schools){
var students = school.Students.Where(s => s.Study == "IT");
}
}
Or if you want to filter the schools you can do
CheckStudents(School.Where(s => s.Students.Any(s => s.Study == "IT")))
... but you still need to have the students within a school filtered in a separate query.
|
|
|
|
|
hello all,
how to convert HTML file to Excel in C# without using any thirt party tool.
Thanks
|
|
|
|
|
Rename it to .xls, and open it in Excel. Presto! Alternatively, you could use ADO.NET (you can look up the connectionstring here[^]).
Those techniques are limited, in the sense that they work with raw data, and not with the Excel DOM; for that you do need a third-party library, or contact Microsoft and write your own.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi Eddy,
I tried with renaming of html file to xls .It did work.But,I got to know that we can convert the Html file to Xml and later that xml file con be converted to .xls
Thanks
|
|
|
|
|
Excel supports multiple formats, and the first thing you need to find out is the lowest version that you need to support. The older versions, like the Excel 95 binary format will require an third-party tool.
For the newer version, I'd recommend the Office OpenXml format; that too, is a complexer format, and you don't want to waste time on reimplementing it yourself. If you only need it as a report, I'd go for Xml, and simply rename it to Xls; that way you wouldn't have access to the advanced functions, just as with ADO.NET.
You'll have to invest some time in looking at the advantages and disadvantages of each of these options
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
how can i create an interface for crystal report at user end.user could be able to move report objects like textobjects from one place to another.pls help me to solve this
|
|
|
|
|
You have already asked this in QA, editing crystal report at user end[^] and received an answer.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Is there not such a control you can host in your app? I know Active Reports did ten years ago, so I expect Crystal does by now.
|
|
|
|
|
Hello
I have question:
- how I can change location my task bar from C# code ?
Default location is in bottom, I need in C# - change position my task bar: left, right, top, bottom.
How I can start ?
|
|
|
|
|
mt1024 wrote: How I can start
I'd start with a Google [^]search, then I'd read some of the responses and see if they give me any ideas for further research.
After that I would refine my searches, read the articles and create a project based on the samples and replies. If I had a specific problem I would either ask on the forum where the article/reply was posted or ask here.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The 'normal' ways of doing this no longer work since Vista - let's face it, it's not great for a user if a program moves their taskbar!
The only way I know of to do this now is to simulate clicking, dragging and releasing the mouse at the right coordinates.
|
|
|
|
|