Advertisement
Advertisement
| 05.05.2008 at 07:27PM PDT, ID: 23378350 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: |
Public Class Form1
Inherits System.Windows.Forms.Form
Private m_oDaysheet As New Daysheet
Private Sub Button_Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Search.Click
m_oDaysheet.Search(TextBox_Search.Text)
Dim rc As Integer = m_oDaysheet.Open("z:\apex\umi\daysheet.dat")
If rc > 0 Then MsgBox(rc)
m_oDaysheet.GetGreaterOrEqual()
If rc > 0 Then MsgBox(rc)
Display()
End Sub
Public Class Daysheet
Protected m_record As DaysheetRec
Protected m_type As Type
Protected m_posblk(128) As Byte
Protected m_data(334) As Byte
Protected m_dataLength As Int16
Protected m_keyBuf(128) As Byte
Protected m_fname() As Byte
Protected m_keyNum As Int16 = 1
Protected m_keyBufLen As Int16
Protected m_ptr As System.IntPtr
Public Sub Search(ByVal sSearch As String)
m_keyBuf = Encoding.ASCII.GetBytes(sSearch)
End Sub
Public Function GetEqual() As Int16
Dim rc As Int16 = Native.BtrCall(Operation.GetEqual, m_posblk, m_ptr, m_dataLength, m_keyBuf, m_keyBufLen, m_keyNum)
m_record = Marshal.PtrToStructure(m_ptr, GetType(DaysheetRec))
Return rc
End Function
Public Function Open(ByVal sTable As String)
Dim rc As Int16
m_keyBufLen = 128
m_fname = Encoding.ASCII.GetBytes(sTable)
m_data(0) = 0
m_dataLength = 0
rc = Native.BtrCall(Operation.Open, m_posblk, m_data, m_dataLength, m_fname, m_fname.Length, m_keyNum)
If rc = 0 Then
m_dataLength = Marshal.SizeOf(m_record)
m_ptr = Marshal.AllocCoTaskMem(m_dataLength)
Marshal.StructureToPtr(m_record, m_ptr, True)
End If
Return rc
End Function
End Class
|