Window form hang while looping

I created a window form, while doing a while loop, the window hang while processing. It will revert back to normal state after it finished processing. How do I prevent my windowm form to hang while processing??? Also I do not understand why it will hang while doing a while loop???

Hello everybody, would you mind if you telling how to design tool menu as MAC OSx.

Similar Messages

  • A particular form hangs while saving in Oracle Apps 11.5.10.2

    Hi Friends,
    I am using Oracle Apps 11.5.10.2 on Linux.
    In a custom Responsibilty ,In a particular form after entering the valuses when i give confirm button the application forms hangs for a long time without saving the values.
    Please let me know the Fix.
    Regards,
    Arun

    Hi,
    Was this working before? If yes, any changes have been done recently?
    Can you find any errors in the Jinitiator Console Window, application log files, and the database log files?
    Please verify that you have no invalid objects in the database. Also, try to generate the form via adadmin and see if this helps.
    In none of the above helps, please obtain FRD file, and see if more details about the error are reported in the log then -- See (Note: 150168.1 - Obtaining Forms Runtime Diagnostics (FRD) In Oracle Applications 11i) for details.
    Regards,
    Hussein

  • Form hangs while calling Report

    Hi, I am converting some Forms/reports from 6i to 10g.
    The form I am testing is calling a report repeatedly using the following code:
    rep_id := Find_Report_Object('FILE_RECORD_DESCRIPTION');
    <<open_files>>
    OPEN files;
    <<get_next_file>>
    FETCH files INTO file_name;
    IF files%NOTFOUND
         THEN
         CLOSE files;
         RETURN;
    END IF;
    :FILE_RECORD_DESC_STATUS := 'Doing file' || file_name;
    SYNCHRONIZE;
    IF :TYPE = 'PDF'
         THEN
         SET_REPORT_OBJECT_PROPERTY (rep_id,REPORT_DESNAME,'C:\DOC\PDF\' || file_name || '.pdf');
         SET_REPORT_OBJECT_PROPERTY (rep_id,REPORT_DESFORMAT,'PDF');
    SET_REPORT_OBJECT_PROPERTY (rep_id,REPORT_OTHER, 'P05_FILES="' || file_name || '"');
    END IF;
    IF :TYPE = 'HTML'
         THEN
         SET_REPORT_OBJECT_PROPERTY (rep_id,REPORT_DESNAME,'C:\DOC\' || file_name || '.htm');
         SET_REPORT_OBJECT_PROPERTY (rep_id,REPORT_DESFORMAT,'HTML');
    SET_REPORT_OBJECT_PROPERTY (rep_id,REPORT_OTHER, 'P05_FILES="' || file_name || '"');
    END IF;
    report := Run_Report_Object(rep_id);
    GOTO get_next_file;
    When REPORT_DESFORMAT is set to ‘HTML’, everything works well. Around 40 .htm documents are created on C:\DOC. But when REPORT_DESFORMAT is set to ‘PDF’ the form hang after creating 10 or 11 .pdf documents!!!
    Any idea what I am doing wrong? Do I have to free up some sort of buffer/memory/other things when creating .pdf document?
    Regards
    Yves

    I tried different things and it seams that the amount of data (i.e the size of the .pdf) determine how many times the report can be called before the form hangs. Form did hang after only 2 call for big report (around 20 pages each) but hangs after several calls for smaller ones???
    Yves

  • Windows XP hangs while booting

    Hi everybody
    I am currently experiencing severe Windows XP SP2 boot problems!
    My system is a MacBook Pro with Intel Core 2 Duo 2.4 GHz. Here is some more system Information:
    * Model Identifier: MacBookPro3,1
    * Boot ROM Version: MBP31.0070.B02
    * SMC Version: 1.16f8
    * RAM: 4GB
    I have installed MacOS X (10.5.1) and Bootcamp. In addition I have installed Windws XP SP2 (German). Currently use and have installed NO additional hardware drivers apart from the BootCamp ones.
    The system hangs sporadically when I boot (using Boot camp) under windows. Windows XP freezes mostly during the initial startup (before the log-in). Sometimes however it freezes after I have logged in and have performed a few operations. These hang-ups happen almost 95% percent of the time. Yet after a couple of new starts and safe mode boots I am able to log in. I would also like to mention that I cannot log in when I boot at safe mode because the built-in MBP keyboard does not work; so I just stop at the log in screen and restart.
    thanks for the help in advance

    I just fixed a Dell Inspiron laptop with a similar boot hang problem. The machine would hang if the iPod was plugged in the USB port, or even a powered USB hub. The machine is 5 years old and is USB 1.1
    The machine would hang in the boot sequence right before it would go to Windows start part. I took USB completely out of the boot sequence and that didn't do it. What did do it, based on a suggested fix from a Dell guy.
    With the iPod unplugged, here is the Dell suggestion which might help some but not this Dell (keep reading below for the fix that worked):
    1. Restart the System. (Unplug the IPod from the system)
    2. Tap <F2> at the Dell Logo to access the BIOS.
    3. Go to the Advanced Tab, and disable the USB legacy support.
    4. Save the changes and exit.
    But on the 1100 that I was working on, it had a older bios and used the Alt-P procedure to page through BIOS options. On page 3, there was a USB Emulation option. If you read the description, there is no way one would think that this would have an effect. I changed this to Disabled and that allowed the machine to boot with the iPod plugged in.
    I hope this helps someone. If your machines hangs before windows starts, get into the BIOS and go to work!! Tom [email protected]

  • Custom pll to disable form messages while looping through block records

    I need to loop through block records in CUSTOM pll to check for if one check box is checked or not. But in that process the messages written at the forn level are popping up which are of no use to the user. I want to disable the messages for my looping. I would enable it after the processing in CUSTOM PLL
    Regards,
    SS

    Hello,
    Here is the Forms forum, and you would increase chances to get an answer by posting in the EBS forum.
    Francois

  • Solution: iTunes 10.6.0.40 on Windows 7 hangs while syncing

    I was trying to Sync Audiobooks to my iPod nano (6th gen) but iTunes 10.6.0.40 (on Win 7 Home Premium 64-bit SP 1) just stopped being responsive after pressing Apply and it showing "preparing to sync" in the status window.  The nano went into sync mode for about 5 seconds but then returned to Connected state. iTunes.exe *32 was running at 100% (on one CPU) and did not even appear to begin the sync. [This state was also entered as soon as I set the "Manually manage music and videos" on the Device's Summary page.] 
    After (wasting) many hours of trying the standard support instructions to uninstall everything from Apple Inc. - iTunes, then Apple Software Update, then Bonjour, then Apple Mobile Device Support, then Apple Application Support - then download (another) copy of iTunes64Setup.exe, then install iTunes - the answer came ...
    A very pleasant, helpful support rep (for case 298676734) thought to try the DOS command "netsh winsock reset" as suggested by wiclee in https://discussions.apple.com/thread/3559328 and sodaboy581 in https://discussions.apple.com/message/16361402#16361402. More explanation of this fix can be found at What does "netsh winsock reset" do? and Repair/Reset Winsock settings.
    I suggest you try this first!!    Hopefully this discussion has enough fo the right tags to help others find this fix!

    More explanation of this fix can be found at What does "netsh winsock reset" do? and Repair/Reset Winsock settings.
    Also see:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (The Winsock key reset has the effect of clearing away the LSP in the cases where it's a conflict with a LSP in play, rather than corruption of the key.)

  • Applicaiton form hangs when trying to make C# form visible from menu event

    I have a MDI windows app, running as an addon on Verion 2007A
    The applicaion is written in C# ( VS 2005)
    I am a newbee to C# ( VS too ) as well.
    All I want is to display the MDI container form when a menu is clicked. But the windows form hangs forever, and does not show.
    if I try to show the form within Main method then no issues! The problem happens only off the SBO menu event .
    I cannot have the form loaded all the time. so I need the services of the SBO menu click, so a user can open it whenever he wants.
    Note: I can open any other form off the menu click, but that , provided they are not MDI containers and they are opened with ShowDialog(); If I use Show(); then again hangs.
    I tried opening the MDI form in Main method, ( wich of course works) and hide it when not needed. I could hide the form, but when I issued a command myForm.visible = true;  through the SBO menu event, again hangs!
    my applicaion Main function is as follows. The class AA_SBO_MAIN  holds the SBO application events.
    static void Main()
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Classes.AA_SBO_MAIN oSBOMain = null;
                oSBOMain = new Classes.AA_SBO_MAIN(); 
                 Application.Run();        
    the menu event simply does
                  frmMain fm = new frmMain();
                  fm.Visible = true;

    Hi
    I try doing these few steps and it seems to work!  The code is in Visual Basic though!
    Declare the form variable
    Private mMDI As New frmMDI
    In your menu click event enter a code like this
    If mMDI Is Nothing Then mMDI = New frmMDI
    mMDI.Visible = True
    On your startup function do something like this
    Public Sub New()
           mMDI.Show() : mMDI.Visible = False
    End Sub
    And more important ... in the form class comment all the code inside the Dispose method
    and finally do the following
    Private Sub frmMDI_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
            Me.Hide()
    End Sub
    it seems to work for me . Hope it helps you too!

  • Prevent form/timer hanging while holding the minimize button

    I got troubles when the customers holding the minimize button (without release) on my form, it make all forms and all timers/controls entirely hanging. And thus make some exception bugs for my application.
     Steps to Reproduce Behavior:
    In Form1,  create a Timer1 & Label1 and paste this code :
    Public Class Form1
    Public a As Long
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Timer1.Enabled = True
    Timer1.Interval = 1
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    a = a + 1
    Label1.Text = a
    End Sub
    End Class
    Press F5 to run the application. You will see the number display on Label1 increase rapidly. Now try to hold the Minimize button and the timer will hang up, label1 stop increasing. Release the minimize button will make the timer resume increasing.
    I want my timer and all controls in form still working while holding the minimize button. Is there any good resolution for my issue ?

    various possible resolution. remove controlbox. remove text. draw text if wanted. draw controls. use system.timers.timer. system menu removed so no menu for move size minimize maximize close available.
    https://msdn.microsoft.com/en-us/library/system.timers.timer(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
    form transparent background in image. movement or buttons not affect timer may affect display speed.
    Option Strict On
    Imports System.Timers
    Public Class Form1
    ' Code from this link - http://www.dreamincode.net/forums/topic/275178-drawing-icon-on-form-border/
    WithEvents Timer1 As New System.Timers.Timer
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
    Me.ControlBox = False
    Me.Text = ""
    Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
    Timer1.Interval = 10
    AddHandler Timer1.Elapsed, AddressOf Timer1_Elapsed
    End Sub
    Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
    Timer1.Enabled = False
    End Sub
    'A form with custom border and title bar.
    'Some functions, such as resize the window via mouse, are not implemented yet.
    'The color and the width of the border.
    Private borderColor As Color = Color.GreenYellow
    Private borderWidth As Integer = 3
    'The color and region of the header.
    Private headerColor As Color = Color.GreenYellow
    Private headerRect As Rectangle
    'The region of the client.
    Private clientRect As Rectangle
    'The region of the title text.
    Private titleRect As Rectangle
    'The region of the minimum button.
    Private miniBoxRect As Rectangle
    'The region of the maximum button.
    Private maxBoxRect As Rectangle
    'The region of the close button.
    Private closeBoxRect As Rectangle
    'The states of the three header buttons.
    Private miniState As ButtonState
    Private maxState As ButtonState
    Private closeState As ButtonState
    'Store the mouse down point to handle moving the form.
    Private x As Integer = 0
    Private y As Integer = 0
    'The height of the header.
    Const HEADER_HEIGHT As Integer = 25
    'The size of the header buttons.
    ReadOnly BUTTON_BOX_SIZE As Size = New Size(15, 15)
    Dim Test As Boolean = False
    Private Sub CustomBorderColorForm_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
    'Draw the header.
    Using b As Brush = New SolidBrush(Color.FromArgb(10, Color.White))
    e.Graphics.FillRectangle(b, headerRect)
    End Using
    'Draw the title text
    If Test = False Then
    Using b As Brush = New SolidBrush(Me.ForeColor)
    e.Graphics.DrawString("Anything you want Baby", Me.Font, b, titleRect)
    End Using
    ElseIf Test = True Then
    Using b As Brush = New SolidBrush(Me.ForeColor)
    e.Graphics.DrawString("Hello Dolly", Me.Font, b, titleRect)
    End Using
    End If
    'Draw the header buttons.
    If Me.MinimizeBox Then
    ControlPaint.DrawCaptionButton(e.Graphics, miniBoxRect, CaptionButton.Minimize, miniState)
    End If
    If Me.MinimizeBox Then
    ControlPaint.DrawCaptionButton(e.Graphics, maxBoxRect, CaptionButton.Maximize, maxState)
    End If
    If Me.MinimizeBox Then
    ControlPaint.DrawCaptionButton(e.Graphics, closeBoxRect, CaptionButton.Close, closeState)
    End If
    'Draw the border.
    ControlPaint.DrawBorder(e.Graphics, clientRect, borderColor, _
    borderWidth, ButtonBorderStyle.Solid, borderColor, borderWidth, ButtonBorderStyle.Solid, borderColor, borderWidth, ButtonBorderStyle.Solid, borderColor, borderWidth, ButtonBorderStyle.Solid)
    End Sub
    'Handle resize to adjust the region ot border, header and so on.
    Private Sub CustomBorderColorForm_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
    headerRect = New Rectangle(Me.ClientRectangle.Location, New Size(Me.ClientRectangle.Width, HEADER_HEIGHT))
    clientRect = New Rectangle(New Point(Me.ClientRectangle.Location.X, Me.ClientRectangle.Y + HEADER_HEIGHT), _
    CType(New Point(Me.ClientRectangle.Width, Me.ClientRectangle.Height - HEADER_HEIGHT), Drawing.Size))
    Dim yOffset = (headerRect.Height + borderWidth - BUTTON_BOX_SIZE.Height) / 2
    titleRect = New Rectangle(CInt(yOffset), CInt(yOffset), _
    CInt(Me.ClientRectangle.Width - 3 * (BUTTON_BOX_SIZE.Width + 1) - yOffset), _
    BUTTON_BOX_SIZE.Height)
    miniBoxRect = New Rectangle(Me.ClientRectangle.Width - 3 * (BUTTON_BOX_SIZE.Width + 1), _
    CInt(yOffset), BUTTON_BOX_SIZE.Width, BUTTON_BOX_SIZE.Height)
    maxBoxRect = New Rectangle(Me.ClientRectangle.Width - 2 * (BUTTON_BOX_SIZE.Width + 1), _
    CInt(yOffset), BUTTON_BOX_SIZE.Width, BUTTON_BOX_SIZE.Height)
    closeBoxRect = New Rectangle(Me.ClientRectangle.Width - 1 * (BUTTON_BOX_SIZE.Width + 1), _
    CInt(yOffset), BUTTON_BOX_SIZE.Width, BUTTON_BOX_SIZE.Height)
    Me.Invalidate()
    End Sub
    Private Sub CustomBorderColorForm_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
    'Start to move the form.
    If (titleRect.Contains(e.Location)) Then
    x = e.X
    y = e.Y
    End If
    'Check and press the header buttons.
    Dim mousePos As Point = Me.PointToClient(Control.MousePosition)
    If (miniBoxRect.Contains(mousePos)) Then
    miniState = ButtonState.Pushed
    ElseIf (maxBoxRect.Contains(mousePos)) Then
    maxState = ButtonState.Pushed
    ElseIf (closeBoxRect.Contains(mousePos)) Then
    closeState = ButtonState.Pushed
    End If
    End Sub
    Private Sub CustomBorderColorForm_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
    'Move and refresh.
    If (x <> 0 And y <> 0) Then
    Me.Location = New Point(Me.Left + e.X - x, Me.Top + e.Y - y)
    Me.Refresh()
    End If
    End Sub
    Private Sub CustomBorderColorForm_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
    'Reset the mouse point.
    x = 0
    y = 0
    'Check the button states and modify the window state.
    If miniState = ButtonState.Pushed Then
    Me.WindowState = FormWindowState.Minimized
    miniState = ButtonState.Normal
    ElseIf maxState = ButtonState.Pushed Then
    If Me.WindowState = FormWindowState.Normal Then
    Me.WindowState = FormWindowState.Maximized
    maxState = ButtonState.Checked
    Else
    Me.WindowState = FormWindowState.Normal
    maxState = ButtonState.Normal
    End If
    ElseIf closeState = ButtonState.Pushed Then
    Me.Close()
    End If
    End Sub
    'Handle this event to maxmize/normalize the form via double clicking the title bar.
    Private Sub CustomBorderColorForm_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDoubleClick
    If (titleRect.Contains(e.Location)) Then
    If Me.WindowState = FormWindowState.Normal Then
    Me.WindowState = FormWindowState.Maximized
    maxState = ButtonState.Checked
    Else
    Me.WindowState = FormWindowState.Normal
    maxState = ButtonState.Normal
    End If
    End If
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    If Test = False Then
    Test = True
    Me.Invalidate()
    Else
    Test = False
    Me.Invalidate()
    End If
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    If Timer1.Enabled = False Then
    Timer1.Enabled = True
    Else
    Timer1.Enabled = False
    End If
    End Sub
    Private Sub Timer1_Elapsed(sender As Object, e As ElapsedEventArgs)
    Invoke(New Timer1sDelegate(AddressOf Timer1sSub))
    End Sub
    Private Delegate Sub Timer1sDelegate()
    Private Sub Timer1sSub()
    Label1.Text = Now.Ticks.ToString
    End Sub
    End Class
    La vida loca

  • While loop hangs in my script

    Hi guys,
    I want to check if SCCM (install windows image) is ready.
    If it's not, than it has to sleep. I want this in a while loop because when it takes longer, it must loop another
    5 minutes.
    When the image is ready it must go back to the rest of this script.
    My loop hangs and the script never finishes. What am i doing wrong?
    Kind regards,
    André
    $compObject = get-wmiobject -query "select * from SMS_R_SYSTEM WHERE Name='$hostName'" -computername "dhgms401" -namespace "ROOT\SMS\site_S01"
    $compObjectstatus = $compObject.client
    do {
    Start-Sleep -Seconds 300
    while ($compObjectstatus -eq 0)
    write "Sccm is klaar "
    Write "$hostName has been started"
    $newHostName = Get-ADComputer -filter {(name -eq $hostName)}

    Not 100% sure but, I believe the issue is with your conditional statement for your while loop
    while ($compObjectstatus -eq 0)
    $compObjectStatus will never change so your while loop will never equal 0 unless it did from the begining. You will have to requery each time to get an update on the status, so possibly create a function on the query end of things, and just run the function
    Function GetStatus
    $compObject = get-wmiobject -query "select * from SMS_R_SYSTEM WHERE Name='$hostName'" -computername "dhgms401" -namespace "ROOT\SMS\site_S01"
    $compObjectstatus = $compObject.client return $compObjectstatus
    do {
    Start-Sleep -Seconds 300
    while (GetStatus -eq 0)
    write "Sccm is klaar "
    Write "$hostName has been started"
    $newHostName = Get-ADComputer -filter {(name -eq $hostName)}
    I cannot test so I do not know if it works as expected
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • Running java process in a while loop using Runtime.exec() hangs on solaris

    I'm writting a multithreaded application in which I'll be starting multiple instances of "AppStartThread" class (given below). If I start only one instance of "AppStartThread", it is working fine. But if I start more than one instance of "AppStartThread", one of the threads hangs after some time (occasionaly). But other threads are working fine.
    I have the following questions:
    1. Is there any problem with starting a Thread inside another thread?. Here I'm executing the process in a while loop.
    2. Other thing i noticed is the Thread is hanging after completing the process ("java ExecuteProcess"). But the P.waitFor() is not coming out.
    3. Is it bcoz of the same problem as given in Bug ID : 4098442 ?.
    4. Also java 1.2.2 documentation says:
    "Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock. "
    I'm running this on sun Solaris/java 1.2.2 standard edition. If any of you have experienced the same problem please help me out.
    Will the same problem can happen on java 1.2.2 enterprise edition.?
    class AppStartThread implements Runnable
    public void run()
    while(true)
    try
    Process P=Runtime.getRuntime().exec("java ExecuteProcess");
    P.waitFor();
    System.out.println("after executing application.");
    P.destroy();
    P = null;
    System.gc();
    catch(java.io.IOException io)
    System.out.println("Could not execute application - IOException " + io);
    catch(java.lang.InterruptedException ip)
    System.out.println("Could not execute application - InterruptedException" + ip);
    catch (Exception e)
    System.out.println("Could not execute application -" + e.getMessage());

    I'm writting a multithreaded application in which I'll
    be starting multiple instances of "AppStartThread"
    class (given below). If I start only one instance of
    "AppStartThread", it is working fine. But if I start
    more than one instance of "AppStartThread", one of the
    threads hangs after some time (occasionaly). But other
    threads are working fine.
    I have the following questions:
    1. Is there any problem with starting a Thread inside
    another thread?. Here I'm executing the process in a
    while loop.Of course this is OK, as your code is always being run by one thread or another. And no, it doesn't depend on which thread is starting threads.
    2. Other thing i noticed is the Thread is hanging
    after completing the process ("java ExecuteProcess").
    But the P.waitFor() is not coming out.This is a vital clue. Is the process started by the Runtime.exec() actually completing or does the ps command still show that it is running?
    3. Is it bcoz of the same problem as given in Bug ID :
    4098442 ?.
    4. Also java 1.2.2 documentation says:
    "Because some native platforms only provide limited
    ed buffer size for standard input and output streams,
    failure to promptly write the input stream or read the
    output stream of the subprocess may cause the
    subprocess to block, and even deadlock. "These two are really the same thing (4098442 is not really a bug due to the reasons explained in the doc). If the program that you are exec'ing produces very much output, it is possible that the buffers to stdout and stderr are filling preventing your program from continuing. On Windows platforms, this buffer size is quite small (hundreds of characters) while (if I recall) on Solaris it is somewhat larger. However, I have seent his behavior causing problem on Solaris 8 in my own systems.
    I once hit this problem when I was 'sure' that I was emitting no output due to an exception being thrown that I wasn't even aware of - the stack trace was more than enough to fill the output buffer and cause the deadlock.
    You have several options. One, you could replace the System.out and System.err with PrintStream's backed up by (ie. on top of) BufferedOutputStream's that have large buffers (multi-K) that in turn are backed up by the original out and err PrintStream's. You would use System.setErr() and System.setOut() very early (static initializer block) in the startup of your class. The problem is that you are still at the mercy of code that may call flush() on these streams. I suppose you could implement your own FilterOutputStream to eat any flush requests...
    Another solution if you just don't care about the output is to replace System.out and System.err with PrintStreams that write to /dev/nul. This is really easy and efficient.
    The other tried and true approach is to start two threads in the main process each time you start a process. These will simply consume anything that is emitted through the stdout and stderr pipes. These would die when the streams close (i.e. when the process exits). Not pretty, but it works. I'd be worried about the overhead of two additional threads per external process except that processes have such huge overhead (considering you are starting a JVM) that it just won't matter. And it's not like the CPU is going to get hit much.
    If you do this frequently in your program you might consider using a worker thread pool (see Doug Lea's Executor class) to avoid creating a lot of fairly short-lived threads. But this is probably over-optimizing.
    Chuck

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Just downloaded Firefox 6.0 and have restarted 4 plus times, but it continues to hang while launching. I cannot open new windows, change any settings, or do anything but Force Quit. I'm on Mac OSX 10.5.8. How do I get past this hang?

    Just downloaded Firefox 6.0 and have restarted 4 plus times, but it continues to hang while launching. I cannot open new windows, change any settings, or do anything but Force Quit. I'm on Mac OSX 10.5.8. How do I get past this hang?

    Long story short: Simply get CC for teams. At 500 bucks a year it's a steal and those 5 licenses in the base package (or was it 10 even?) cover all your computers, at least the 3 ones you mentioned. For system requirements refer to the individual product pages.
    Mylenium

  • Editing While Loop Conditions hangs JDeveloper 10.1.3

    Hi Guys,
    Having a strange problem when I tried to edit the condition in a while loop after it was created and set first time. The IDE just hanged when I tried to open the expression builder and after a while, nothing happened, the expression builder didn't show up.
    I went and deleted the condition by editing the source, basically made condition from:
    <while name="While_1"
    condition="bpws:getVariableData('inputVariable','payload','/client:WhileLoopTesterProcessRequest/client:input')&lt;10">
    to
    <while name="While_1"
    condition="">
    Switched back to graphics mode, the expression builder opens up normally.
    I understand that we are evaluation a Developers Preview, so just wanted to bring this to the notice of the developers.
    Any solutions before the Production release?
    Regards,
    - Soumen.

    Hi Willian,
    Did you set up your "Model" Project to use the JDK 1.4 and rebuild the application ?
    See " [Deploying to Application Servers That Support JDK 1.4|http://tinyurl.com/lfc6kc] "
    Regards,
    Didier.

  • Labview as the active window disables 1 or 2 concurrent while loops

    I am trying to get familiar with new mutltifunction DAQ hardware from IOtech - a DAQborad/2000.
    I have a simple vi consisting of two while loops which should be running in parallel. One acquires analog input data, the other handles DAC outputs.
    When I run the vi, the analog acquisition while loop runs fine, but the DAC while loop will not run if labview is the active window on the pc (frontpanel or diagram). If I make another window active, both loops will update as they should.
    I can resize a windows explorer window to make it small, run my vi, make windows explorer the active window and see the vi running both loops and updating as it should in the background. If I use the "Highlight Executi
    on" tool on the diagram screen, both loops run as they should.
    Any ideas?
    Thanks,
    Mike

    > I am trying to get familiar with new mutltifunction DAQ hardware from
    > IOtech - a DAQborad/2000.
    >
    Many third party drivers default to running in LV's UI thread, and if
    they put the thread to sleep, other LV threads can run, but not the UI.
    It is also possible that one of the loops is hogging while the other
    is being starved.
    So, I've got two suggestions to try. First try putting a delay of a few
    ms in the busy loop. This might help with the starvation. The second
    thing to try is to open up the IOTech VI and try setting the DLL node to
    be reentrant. This will allow the node to run in any thread and not
    force it into the UI thread. Beware that if the DLL isn't threadsafe,
    this could lead to data corruption or crashes, and before leaving it s
    et
    this way, you should probably contact IOTech to see if their DLL is
    threadsafe. If it is not, contact NI tech support and they can help you
    determine if it is safe in this case to leave it running in other threads.
    Greg McKaskle

  • Program hangs at While loop breakpoint while stepping

    I have a breakpoint set on a While loop. I run the program and it stops at the breakpoint. I set up some probes and continue to run through the loop. After several iterations the program will not respond to further run commands.

    This sounds incredbly bizarre.
    Could you post this code for us to look at?
    I have seen one strange thing using the debugging tools and this is not it.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • "This computer is already associated with an Apple ID" - meaning of "Transfer"?

    Hello everybody I have two iTunes accounts and Match connected to one of them. When I got my new Macbook I connected it to the iTunes account that does not have Match connected. Nevertheless, I am able to log in to the account with Match connected, b

  • Need As Much Help As Possible As Really Confused

    On June 22nd my iMac decided to die out on me--I'm still hoping to get it repaired or if anything my data recovered.  My former computer was still running on the Tiger edition of Safari.  At the same time that I got that computer five years ago, I ha

  • Adding a merge field to an email hyperlink in a word 2010 email mailmerge

    I am using word 2010, excel 2010, and outlook 2010 to send out the following email with email mailmerge to 50 + people. The highlighted names in the greeting are two merge fields - First_Name and Last_Name. The hyperlink is an email hyperlink to the

  • Condition type for discount on quantity basis

    hi all in pricing procedure of MM, i want to make a discount on quantity basis. for ex- 100q- 2% discount. which condition type i have to maintan thankx susanta

  • Photoshop Elements Trial

    I was told I could download Photoshop Elements to try during the first 30 days of Creative Cloud. I don't see it in the download center. How do I do this?