Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
E

erikash

@erikash
About
Posts
10
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Presentation Model - Winforms
    E erikash

    Thanks for the helpful reply! =) I've explored this subject some more, and came across the CSLA.NET framework, As it seems the framework implementation does exacly that =) I'm still learning it, but it looks promising... Did anyone use this framework and implemented the Presentation Model pattern??? It seems rather cumbersome to wrap the CSLA entities with ViewModels, because them the ViewModel will have to implement all the interfaces and forward any calls to he CSLA entities... (And of course the ViewModel will have additional logic to help support the UI and DataBinding) BTW, If i'm not using the Presentation Model Pattern, and I have this rule for example: The row of a customer in a grid must be green if the customer ordered more than 10 items, at a price higher than 20$. If i'm using Presentation Model, then my customer's ViewModel will have a property OrderedMoreThanTenItemsAt20DollarsEach (for example), which will implement this logic and the view will use DataBinding to bind the rows color property. How will i implement this using the Supervising Controller pattern? (I guess passive view will just iterate through the rows in the grid). Thanks in advance, Erik.

    Windows Forms csharp css wpf winforms wcf

  • Presentation Model - Winforms
    E erikash

    Hi, i'm looking for a way to bind a BindingList to a grid... (allow adding a new row in the grid). If i'll use BindingList, i know it will work... but binding to he ViewModel allows me to add additional presenation logic to the class. How did you solve this? Thanks in advance, Erik.

    Windows Forms csharp css wpf winforms wcf

  • Writing redirected output from an unmanaged executable to a windows form control
    E erikash

    ok this almost solved the problem ;) The program works perfectly if the process executed runs for a short amount of time, but if that process works a couple of minutes than it takes a pretty long time for the redirected output to show in the textbox (output in the other process is written continuously while calculating) any suggestions? Thanks in advance, Erik

    C# com tools help question

  • Writing redirected output from an unmanaged executable to a windows form control
    E erikash

    hi guys, finally i have something that works: private void RunAlgorithm() { m_prsAlgorithm = new Process(); m_prsAlgorithm.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; m_prsAlgorithm.StartInfo.FileName = "Lottery.exe"; m_prsAlgorithm.StartInfo.UseShellExecute = false; m_prsAlgorithm.StartInfo.RedirectStandardInput = true; m_prsAlgorithm.StartInfo.RedirectStandardOutput = true; m_prsAlgorithm.StartInfo.CreateNoWindow = true; m_prsAlgorithm.OutputDataReceived += new DataReceivedEventHandler(prsAlgorithm_OutputDataReceived); m_prsAlgorithm.Start(); m_prsAlgorithm.BeginOutputReadLine(); System.IO.StreamWriter swWriter = m_prsAlgorithm.StandardInput; swWriter.WriteLine(m_strArgList); swWriter.Close(); m_prsAlgorithm.WaitForExit(); ProcessExitedCallback pecProcessExited = new ProcessExitedCallback(OnProcessExited); m_prsAlgorithm.WaitForExit(); btnRun.Invoke(pecProcessExited, new object[] { }); } i've inserted this into a function and called this function in a new thread (from the main thread) and it seems to work like a charm... :) does anyone know why this solved the problem? Thanks in advance, Erik.

    C# com tools help question

  • Writing redirected output from an unmanaged executable to a windows form control
    E erikash

    hi again guys, still same problem, this time i'll post my code: (the previous thread : Link m_prsAlgorithm = new Process(); m_prsAlgorithm.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; m_prsAlgorithm.StartInfo.FileName = "Lottery.exe"; m_prsAlgorithm.StartInfo.UseShellExecute = false; m_prsAlgorithm.StartInfo.RedirectStandardInput = true; m_prsAlgorithm.StartInfo.RedirectStandardOutput = true; m_prsAlgorithm.OutputDataReceived += new DataReceivedEventHandler(prsAlgorithm_OutputDataReceived); m_prsAlgorithm.Start(); m_prsAlgorithm.BeginOutputReadLine(); System.IO.StreamWriter swWriter = m_prsAlgorithm.StandardInput; swWriter.WriteLine(m_strArgList + " d"); swWriter.Close(); m_prsAlgorithm.WaitForExit(); } void prsAlgorithm_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e) { this.txtOutput.Text += e.Data; //this.SetText(e.Data); } the code above couses my program to freeze (just hangs), if i uncomment the code in void prsAlgorithm_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e) and comment out the: this.txtOutput.Text += e.Data; it works but it's not thread safe and it only shows me the output when the other process has finished... any suggestions? Thanks in advance, Erik.

    C# com tools help question

  • Writing redirected output from an unmanaged executable to a windows form control
    E erikash

    Thanks for the replies guys, umseker thats almost exacly what i wrote... the problem is that the window doesn't repaint itself until the other process has finished (i presume). Anyway i'll post the code when i'll get home... Erik.

    C# help question database com tools

  • Writing redirected output from an unmanaged executable to a windows form control
    E erikash

    hi guys, this question related to my previous post: Link The current problem is redirecting the output to a textbox... there is the issue of a thread different from form's thread, trying to access the textbox.text property (i've read an article in msdn, i which they query the invokerequired property of the textbox and invoke it same method using this.invoke, but it doesn't seem to solve the problem) again, i want to start a new process and redirect its output to a textbox at runtime (every line of text written by the process should be written at runtime at the textbox, without waiting for the process to finish)... the answer in the first reply i got helped, but i couldn't make it thread safe (and in the buttom line i think it wrote the output to the textbox, but the window couldn't refresh itself until the other process has finished... any suggestions? Thanks in advance, Erik.

    C# help question database com tools

  • redirecting output from an unmanaged console application
    E erikash

    Hi guys, i'm executing a console application using : Process prsAlgorithm = new Process(); prsAlgorithm.StartInfo.WindowStyle = ProcessWindowStyle.Normal; prsAlgorithm.StartInfo.FileName = "Lottery.exe"; prsAlgorithm.StartInfo.UseShellExecute = false; prsAlgorithm.StartInfo.RedirectStandardInput = true; prsAlgorithm.StartInfo.RedirectStandardOutput = true; prsAlgorithm.Start(); System.IO.StreamWriter swWriter = prsAlgorithm.StandardInput; System.IO.StreamReader srReader = prsAlgorithm.StandardOutput; swWriter.WriteLine(m_strArgList); swWriter.Close(); // Some thing goes here prsAlgorithm.WaitForExit(); i need to redirect the output of this console application to a textbox on a window form, but the problem is that i want that every line written in the console application, would be automaticaly written to the textbox (and not wait until the console application has exited)... i'm pretty sure it has something to do with asynchronousy reading a stream or something like that...? any suggestions? Thanks in advance, Erik.

    C# help question

  • Executing an executable unmanaged exe file...
    E erikash

    Thanks guys! Ok next question... the executable exe file gets input from the user (using scanf) is there a way to supply it arguments without changing the source code of the executable? (by changing the main to receive parameters and modifing the source code accordingly) I guess it has something to to with adding values to the input buffer of that application...? Thanks in advance, Erik.

    C# question

  • Executing an executable unmanaged exe file...
    E erikash

    Hi guys, i need to execute such a file and supply it arguments, i've looked around and found the "System.Diagnostics.Process.Start()" method, it works great, but i want controll over the executed application... or at least run it in a minimized window state... any suggestions? (The executable is a program written in c) Thanks in advance, Erik.

    C# question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups