Click here to Skip to main content
15,921,646 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz2-Mar-07 3:01
Stefan Troschuetz2-Mar-07 3:01 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com2-Mar-07 7:11
jtamil2001@yahoo.com2-Mar-07 7:11 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz4-Mar-07 6:56
Stefan Troschuetz4-Mar-07 6:56 
QuestionWindows Service in background Pin
dannygilbert328-Feb-07 7:36
dannygilbert328-Feb-07 7:36 
AnswerRe: Windows Service in background Pin
kryzchek28-Feb-07 10:05
kryzchek28-Feb-07 10:05 
QuestionThread question Pin
teejayem28-Feb-07 7:29
teejayem28-Feb-07 7:29 
AnswerRe: Thread question Pin
CPallini28-Feb-07 9:44
mveCPallini28-Feb-07 9:44 
GeneralRe: Thread question Pin
teejayem28-Feb-07 10:43
teejayem28-Feb-07 10:43 
Thank you for the reply. Below is what i have going on:

This is where i create the thread
m_objPrintThread = new PrintThread(m_objUV, this, m_sRecKey, m_DailyRec);
m_objPrintThreadID = new Thread(m_objPrintThread.ThreadStart);


m_objPrintThreadID.Start();


This is what is basically going in the thread. There are three functions I only put one in here to save space.
namespace CashRec
{
    public delegate bool PrintCashRec(); // Delegate

    class PrintThread
    {
        UONET m_objUV;
        string m_sKey, m_sRec;
        frmMain m_form;
        volatile bool m_bShouldStop = false;       
 
        public PrintCashRec m_PrintRec;

        public PrintThread(UONET objUV, frmMain form, string sKey, string sRec)
        {
            m_form = form;
            m_objUV = objUV;
            m_sKey = sKey;
            m_sRec = sRec;
            m_PrintRec = new PrintCashRec(Print);
        }

        public void ThreadStart()
        {
            while (!m_bShouldStop)
            {
                Thread.Sleep(500);
            }
        }

        public void ThreadStop()
        {
            m_bShouldStop = true;
        }

        private Boolean Print()
        {
            bool bSuccessful = false;

            while (!bSuccessful)
            {
                  // Logic Here
            }

            return bSuccessful;
        }



Here basically i am calling the delegate and i would expect it to just signal the thread to call the print function without it hanging the main form. But it still hangs the form.
private void mnuPrint_Click(object sender, EventArgs e)
{
    if (m_objPrintThread == null)
    {
        if (StartPrintThread())
            m_objPrintThread.m_PrintRec;
    }
    else
        m_objPrintThread.m_PrintRec;
}


Thanks again for your help

Don't be overcome by evil, but overcome evil with good

GeneralRe: Thread question Pin
CPallini28-Feb-07 11:18
mveCPallini28-Feb-07 11:18 
GeneralRe: Thread question Pin
pbraun4-Mar-07 4:24
pbraun4-Mar-07 4:24 
GeneralRe: Thread question Pin
teejayem5-Mar-07 12:35
teejayem5-Mar-07 12:35 
AnswerRe: Thread question Pin
pbraun5-Mar-07 13:41
pbraun5-Mar-07 13:41 
QuestionMP3 in memorystream Pin
neurobion28-Feb-07 6:38
neurobion28-Feb-07 6:38 
QuestionSimple program for USB joystick [modified] Pin
quwip1028-Feb-07 6:37
quwip1028-Feb-07 6:37 
AnswerRe: Simple program for USB joystick Pin
Wayne Phipps28-Feb-07 8:43
Wayne Phipps28-Feb-07 8:43 
GeneralRe: Simple program for USB joystick Pin
quwip101-Mar-07 6:07
quwip101-Mar-07 6:07 
AnswerRe: Simple program for USB joystick Pin
Dave Kreskowiak1-Mar-07 2:24
mveDave Kreskowiak1-Mar-07 2:24 
Questionreturn generic collection from webservice Pin
arkiboys28-Feb-07 6:01
arkiboys28-Feb-07 6:01 
AnswerRe: return generic collection from webservice Pin
kubben28-Feb-07 6:06
kubben28-Feb-07 6:06 
GeneralRe: return generic collection from webservice Pin
arkiboys28-Feb-07 6:23
arkiboys28-Feb-07 6:23 
GeneralRe: return generic collection from webservice Pin
kubben28-Feb-07 6:25
kubben28-Feb-07 6:25 
GeneralRe: return generic collection from webservice Pin
arkiboys28-Feb-07 6:27
arkiboys28-Feb-07 6:27 
GeneralRe: return generic collection from webservice Pin
kubben28-Feb-07 6:30
kubben28-Feb-07 6:30 
GeneralRe: return generic collection from webservice Pin
arkiboys28-Feb-07 6:32
arkiboys28-Feb-07 6:32 
GeneralRe: return generic collection from webservice Pin
kubben28-Feb-07 6:35
kubben28-Feb-07 6:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.