Click here to Skip to main content
15,937,429 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My program is operate in new Widows CE device. This device include Barcode reader and RFID reader. My RFID reader function can't run with new device. However, it will be operated on old Windows CE Device.

XML
mports System
Imports System.Runtime.InteropServices
Imports System.Text

Public Class uniRFID

    <DllImport("uniRFID.dll")> _
       Public Shared Function uniRFIDOpen(ByVal ReaderType As UInteger) As UInteger
        'Public Shared Function uniRFIDOpen(ByVal ReaderType As UInteger) As System.IntPtr

    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDClose(ByVal hRFID As System.IntPtr) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDGetUID(ByVal hRFID As System.IntPtr, ByVal szUID As StringBuilder, ByRef dwReadedBytes As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDGetUID_ANSI(ByVal hRFID As System.IntPtr, ByRef szUID As StringBuilder, ByVal dwReadedBytes As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDRead(ByVal hRFID As System.IntPtr, ByVal szUID As StringBuilder, ByRef dwReadedBytes As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDWrite(ByVal hRFID As System.IntPtr, ByVal szUID As StringBuilder, ByRef dwReadedBytes As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDSetBlockNum(ByVal hRFID As System.IntPtr, ByVal dwBlockNum As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDGetBlockNum(ByVal hRFID As System.IntPtr, ByRef dwBlockNum As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDSetTagType(ByVal hRFID As System.IntPtr, ByVal dwTagType As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDGetTagType(ByVal hRFID As System.IntPtr, ByRef dwTagType As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDSetBlockKey(ByVal hRFID As System.IntPtr, ByVal szBlockKey As StringBuilder, ByVal dwWriteBytes As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDAPIVersion(ByVal szAPIVersion As StringBuilder) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDLoadKey(ByVal hRFID As System.IntPtr, ByVal dwSector As UInteger, ByVal szKeyA As StringBuilder, ByVal szKeyB As StringBuilder) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDClearKey(ByVal hRFID As System.IntPtr, ByVal dwSector As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDKeyState(ByVal hRFID As System.IntPtr, ByVal dwSector As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDReadBlock(ByVal hRFID As System.IntPtr, ByVal dwBlockNum As UInteger, ByVal szdata As StringBuilder, ByRef dwReadBytes As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDReadBlockKeyHex(ByVal hRFID As System.IntPtr, ByVal dwBlockNum As UInteger, ByVal szdata As StringBuilder, ByRef dwReadBytes As UInteger, ByVal szKeyType As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDWriteBlockKeyHex(ByVal hRFID As System.IntPtr, ByVal dwBlockNum As UInteger, ByVal szdata As StringBuilder, ByVal dwWriteBytes As UInteger, ByVal szKeyType As UInteger) As UInteger
    End Function

    <DllImport("uniRFID.dll")> _
    Public Shared Function uniRFIDWriteHex(ByVal hRFID As System.IntPtr, ByVal szdata As StringBuilder, ByVal dwWriteBytes As UInteger, ByVal szKeyType As UInteger) As UInteger
    End Function

    Public Enum ReaderType
        PA962HF1 = 0
        UNKNOW_READER
    End Enum

    Public Enum TagType
        TAG_ISO14443A = 1
        TAG_ISO15693 = 7
        TAG_MIFARE = 8
    End Enum
End Class


I don't know why can't read. Help me plz :-(
Posted
Comments
bbirajdar 19-Apr-12 5:24am    
Log the exceptions to a text file and check the error occusring.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900