Re: Window Form conversion
Dave Vorgang <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <34BDEF4FDF97EC46B7565B38A5F93FF701EA101DDD5A@MSDMAIL.medford.k12.or.us> |
When I create the object which loads the form I don't specifically create it on a separate thread. I don't know if it does under the hood. If it does I would imagine I could do what you suggest but I don't know how at this point. As far as Fujitsu, I just loaded the vs2005 version of it. Intellasence doesn't work (might be my fault) and I really haven't got into it yet. I'm currently just trying to code some vb console routines to bring up my forms. After that I will try to use Cobol to bring up the forms. Also, Fujitsu is suppose to be out (eta end of November) with a fully functioning version of Cobol for VS2008 .net 3.5 I'm also looking at MVC pattern to see if that might work for this problem. Any more help on this would be appreciated. Thanks, Dave Vorgang Senior Programmer / Analyst Medford School District - Information Technology (541) 842-1021 mailto:[email protected] -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[email protected]] On Behalf Of John Warner Sent: Tuesday, October 21, 2008 8:46 AM To: [email protected] Subject: Re: [ADVANCED-DOTNET] Window Form conversion I haven't looked at this specifically, but can't you put the main thread to sleep aside from just spawned threads? If you need to halt your code until the user hits a key I would want to do something like that rather then a do loop of DoEvents(). I think the reason this eats so much CPU is all the stack work that is going on with DoEvents, you are in a tight loop forcing Windows to do a lot of pushing and popping even if there are no messages pending. On an aside, what is Fujitsu Cobol like in the .net environment? I ask as someone here has suggested it as a possible solution to a problem with so data from a mainframe. John Warner > -----Original Message----- > From: Discussion of advanced .NET topics. > [mailto:[email protected]] On Behalf Of > Dave Vorgang > Sent: Tuesday, October 21, 2008 11:33 AM > To: [email protected] > Subject: [ADVANCED-DOTNET] Window Form conversion > > > Hi All, > > I have just began working on this project for converting our > existing HP3000 Vplus screens to use Fujitsu Cobol.Net on > backend and use .Net for the forms. > > What I plan to do is create routines to emulate the Vplus > intrinsics. For example, I have this routine to display the form: > > Private WithEvents _VFormFile As VplusBaseScreen.BaseFormMain > > Public Function VshowForm(ByVal comArea As > ComAreaDefinition) As Boolean > _VFormFile.LoadScreen(_CurrentScreen) > _VFormFile.Show() > End Function > > > Then, this routine would perform the Vreadfields which > basically blocks execution of my application until _KeyEntered = True > > Public Function VreadFields(ByVal comArea As > ComAreaDefinition) As Boolean > _VFormFile.Focus() > _KeyEntered = False > Do Until _KeyEntered > System.Windows.Forms.Application.DoEvents() > Loop > > End Function > > Then, the form will raise events and set _KeyEntered = True > when there is user interaction and the main process will > catch those events like this: > Private Sub _VFormFile_LastKeyPressed(ByVal key As > Integer) Handles _VFormFile.LastKeyPressed > _KeyEntered = True > RaiseEvent LastKeyPressed(key) > End Sub > The above routine just raises the event back to its caller. > > This approach actually works but the Do Loop take 25% of the cpu. > > So, my question is: Is there a better way to accomplish what > I'm trying to do? Can/How would I place this on a different > thread (if that's a way I should do it). > > > Thanks, > > > Dave Vorgang > Senior Programmer / Analyst > Medford School District - Information Technology > (541) 842-1021 > mailto:[email protected]<BLOCKED::mailto:Dave.Vor [email protected]> =================================== View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives =================================== View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives =================================== View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives