Window Form conversion

Dave Vorgang <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <34BDEF4FDF97EC46B7565B38A5F93FF701EA101DDD4E@MSDMAIL.medford.k12.or.us>
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:[email protected]>


===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.