Re: AW: [development-axapta] Thread programming in Axapta
Hi Helmut I have been working using tutorial_Thread as example. The example is fairly straightforward, exept I'm not really that experienced in Axapta, I actually thought 5 minutes ago I had it done, using this approach: On the button clicked I call a threads static method Run(element) hence sending my form on as parameter to the thread. Using Tutorial_Thread as guide, my run method creates a new thread t, and sets the inputparameter calling setInputParm(container), just now I realised that a container is limited in the way, that it cannot contain objects (I come from a world where objects are just as valid types as any other types) So what I'm looking for now, is a way to send a pointer (I know, there are no pointers in Axapta) to my thread, so it can work on some GUI. I'll try to have a look at SysDataSearchDaemon /Jens "HEW \(Helmut Wimmer\)" <[EMAIL PROTECTED]> To <[EMAIL PROTECTED] 05-08-2004 11:51 > cc Please respond to Subject development-axapt AW: [development-axapta] Thread [EMAIL PROTECTED] programming in Axapta Hi Jens There is an (undocumented) system class "thread" that can be used to handle thread runs. To figure out how it may work you can look at the classes that use that system class. Examples are: SysDataSearchDaemon, tutorial_Thread (!) Hope it helps a little. Helmut -Ursprüngliche Nachricht- Von: Jens Fudge [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 05. August 2004 10:52 An: [EMAIL PROTECTED] Betreff: [development-axapta] Thread programming in Axapta Hi all I'm trying to grasp how the threading possibilities in Axapta are. Basically I'm trying to build the following scenario: A form with a listbox, in the form I have declared a variable of integer type. There are two buttons on the form. Button1 creates and starts a thread that in a for-loop increments (i++) the variabel on the form, with a sleep of one second in the loop. After incrementing the value of the variabel is written to the listbox. Button2 creates and starts a thread that in a for-loop decrements (i--) the variabel on the form, with a sleep of two seconds in the loop. After decrementing the value of the varaibel is written to the listbox. I have encountered some problems.. I build the threads in seperate classes, they are initialised from the buttons on the form, how do I from the thread access the forms variabel? How do I access the listbox? How do I enter and leave critical sections? Hope someone out there can give me a clue of where to go Thanks in advance Jens Yahoo! Groups Links Yahoo! Groups Sponsor ADVERTISEMENT click here Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/
RE: [development-axapta] Thread programming in Axapta
Hi Jens and Helmut, Be careful with the Thread class - it works extremely unstable (tried on SP3 and earlier service packs). It might crash your system, so be aware of this. I just tried the tutorial called tutorial_thread (it's a form) and quit Axapta. Then I've got a nice greeting from SmartHeap Library: "MEM_BAD_POINTER". Then afterwards, I got a Runtime error. Once I thought about using it for a search routine but I decided not to after finding out about the stability (or the lack of). The standard form SysAotFind form is using a little trick with the setTimeOut method to enable user input during the search. Perhaps you can get some ideas from there. The standard form SystemDate also uses (among many other forms) the setTimeOut method. Greetings, Lars -Original Message- From: HEW (Helmut Wimmer) [mailto:[EMAIL PROTECTED] Sent: 5. august 2004 11:52 To: [EMAIL PROTECTED] Subject: AW: [development-axapta] Thread programming in Axapta Hi Jens There is an (undocumented) system class "thread" that can be used to handle thread runs. To figure out how it may work you can look at the classes that use that system class. Examples are: SysDataSearchDaemon, tutorial_Thread (!) Hope it helps a little. Helmut -Ursprüngliche Nachricht- Von: Jens Fudge [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 05. August 2004 10:52 An: [EMAIL PROTECTED] Betreff: [development-axapta] Thread programming in Axapta Hi all I'm trying to grasp how the threading possibilities in Axapta are. Basically I'm trying to build the following scenario: A form with a listbox, in the form I have declared a variable of integer type. There are two buttons on the form. Button1 creates and starts a thread that in a for-loop increments (i++) the variabel on the form, with a sleep of one second in the loop. After incrementing the value of the variabel is written to the listbox. Button2 creates and starts a thread that in a for-loop decrements (i--) the variabel on the form, with a sleep of two seconds in the loop. After decrementing the value of the varaibel is written to the listbox. I have encountered some problems.. I build the threads in seperate classes, they are initialised from the buttons on the form, how do I from the thread access the forms variabel? How do I access the listbox? How do I enter and leave critical sections? Hope someone out there can give me a clue of where to go Thanks in advance Jens Yahoo! Groups Sponsor ~--> Yahoo! Domains - Claim yours for only $14.70 http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM <http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM> ~-> Yahoo! Groups Links Yahoo! Groups Sponsor ADVERTISEMENT <http://us.ard.yahoo.com/SIG=129at4t9g/M=295196.4901138.6071305.3001176/D=groups/S=1705006764:HM/EXP=1091787518/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com> click here <http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=665471652> _ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ <http://groups.yahoo.com/group/development-axapta/> * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . [Non-text portions of this message have been removed] Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
AW: [development-axapta] Thread programming in Axapta
Hi Jens There is an (undocumented) system class "thread" that can be used to handle thread runs. To figure out how it may work you can look at the classes that use that system class. Examples are: SysDataSearchDaemon, tutorial_Thread (!) Hope it helps a little. Helmut -Ursprüngliche Nachricht- Von: Jens Fudge [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 05. August 2004 10:52 An: [EMAIL PROTECTED] Betreff: [development-axapta] Thread programming in Axapta Hi all I'm trying to grasp how the threading possibilities in Axapta are. Basically I'm trying to build the following scenario: A form with a listbox, in the form I have declared a variable of integer type. There are two buttons on the form. Button1 creates and starts a thread that in a for-loop increments (i++) the variabel on the form, with a sleep of one second in the loop. After incrementing the value of the variabel is written to the listbox. Button2 creates and starts a thread that in a for-loop decrements (i--) the variabel on the form, with a sleep of two seconds in the loop. After decrementing the value of the varaibel is written to the listbox. I have encountered some problems.. I build the threads in seperate classes, they are initialised from the buttons on the form, how do I from the thread access the forms variabel? How do I access the listbox? How do I enter and leave critical sections? Hope someone out there can give me a clue of where to go Thanks in advance Jens Yahoo! Groups Sponsor ~--> Yahoo! Domains - Claim yours for only $14.70 http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM ~-> Yahoo! Groups Links Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Thread programming in Axapta
Hi all I'm trying to grasp how the threading possibilities in Axapta are. Basically I'm trying to build the following scenario: A form with a listbox, in the form I have declared a variable of integer type. There are two buttons on the form. Button1 creates and starts a thread that in a for-loop increments (i++) the variabel on the form, with a sleep of one second in the loop. After incrementing the value of the variabel is written to the listbox. Button2 creates and starts a thread that in a for-loop decrements (i--) the variabel on the form, with a sleep of two seconds in the loop. After decrementing the value of the varaibel is written to the listbox. I have encountered some problems.. I build the threads in seperate classes, they are initialised from the buttons on the form, how do I from the thread access the forms variabel? How do I access the listbox? How do I enter and leave critical sections? Hope someone out there can give me a clue of where to go Thanks in advance Jens Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.