call function for button


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: call function for button

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Posts
    4

    call function for button

    hi, i'm a newbie on programming.

    i am using smart card reader and have the sdk(gsdkpcsc.dll) for programming.
    then, i already wite down all the declaratiion for the module.

    i also have made the command button.

    my project is,
    i) when click at the READ button, it will start communication with smart card in
    the card reader, then it'll get the identification number from the smart card,
    12 digit.then, the number appeared at text box
    ii) by clicking verify buuton,the 12 digit number is compared with the database
    with m Access
    iii) if matches with databse, then it will send a unique charachter such as AEI
    at the serial port of my microcontrooler. this project is for 2 user.
    iv) if not match, then it says, access is denied.

    my problem s, i need help on the code lines for READ and VERIFY..
    can anyone help?
    READ > open session, commnubication, get data
    VERIFY > match with database and send AEI(user 1), IOU(user 2) to serial port
    i need to get 12 digit numb for this function \Declare Function JPN_IDNum Lib "gsdkpcsc.dll" _

    my module code :

    /********************************************************
    Option Explicit


    '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    ' General Declaration
    '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Declare Function OpenReader Lib "gsdkpcsc.dll" Alias "_OpenReader@0" _
    () As Integer ' open communication session with the card reader

    Declare Function cardConnect Lib "gsdkpcsc.dll" Alias "_CardConnect@12" _
    (ByVal port As Integer, ByVal Rdrname As String, ByVal nRdrLen As Integer) As Long
    ' open communication session with the card in the reader

    Declare Function CardDisconnect Lib "gsdkpcsc.dll" _
    Alias "_CardDisconnect@0" _
    () As Integer
    ' Closes communication session with the card in the reader

    Declare Function CloseReader Lib "gsdkpcsc.dll" Alias "_CloseReader@0" _
    () As Integer
    ' Closes communication session with the card reader

    Declare Function CardDetect Lib "gsdkpcsc.dll" Alias "_CardDetect@4" _
    (ByVal pcExplanation As String) As Integer
    ' Checks if card is in card reader

    Declare Function ResetCard Lib "gsdkpcsc.dll" Alias "_ResetCard@0" _
    () As Long
    ' Reset the card

    Declare Function GetError Lib "gsdkpcsc.dll" Alias "_GetError@0" _
    () As Integer
    ' returns information on last error that occured

    Declare Function SelJPNApp Lib "gsdkpcsc.dll" Alias "_SelJPNApp@0" _
    () As Integer
    ' select JPN to read JPN data

    Declare Function SelJPJApp Lib "gsdkpcsc.dll" Alias "_SelJPJApp@0" _
    () As Integer
    ' select JPJ to read JPJ data

    Declare Function SelIMMApp Lib "gsdkpcsc.dll" Alias "_SelIMMApp@0" _
    () As Integer
    'Select IMM to read IMM data

    '*************************************************************************
    ' JPN section
    '*************************************************************************

    Declare Function JPN_OrgName Lib "gsdkpcsc.dll" _
    Alias "_JPN_OrgName@4" _
    (ByVal pbOrgName As String) As Integer
    'original name in 150 bytes

    Declare Function JPN_MyKadName Lib "gsdkpcsc.dll" _
    Alias "_JPN_MyKadName@4" _
    (ByVal pbMyKadName As String) As Integer
    ' 3 lines of name stored in blocks 0f 30+30+20=80

    Declare Function JPN_KPTName Lib "gsdkpcsc.dll" _
    Alias "_JPN_KPTName@4" _
    (ByVal pbKPTName As String) As Integer
    ' KPTName is 40bytes , 2 lines of name stored in blocks of 20+20=40

    Declare Function JPN_IDNum Lib "gsdkpcsc.dll" _
    Alias "_JPN_IDNum@4" _
    (ByVal pbIDNum As String) As Integer
    ' ID number in 13bytes

    Declare Function JPN_Gender Lib "gsdkpcsc.dll" _
    Alias "_JPN_Gender@4" _
    (ByVal pbGender As String) As Integer
    ' Gender is 1 byte(L for lelaki , P for perempuan)

    Declare Function JPN_OldIDNum Lib "gsdkpcsc.dll" _
    Alias "_JPN_OldIDNum@4" _
    (ByVal pbOldIDNum As String) As Integer
    ' Old ID Number is 8 bytes

    Declare Function JPN_BirthDate Lib "gsdkpcsc.dll" _
    Alias "_JPN_BirthDate@4" _
    (ByVal pbBirthDate As String) As Integer
    ' Date of birth is 4 bytes (numeric)

    Declare Function JPN_BirthPlace Lib "gsdkpcsc.dll" _
    Alias "_JPN_BirthPlace@4" _
    (ByVal pbBirthPlace As String) As Integer

    Declare Function JPN_DateIssued Lib "gsdkpcsc.dll" _
    Alias "_JPN_DateIssued@4" _
    (ByVal pbDateIssued As String) As Integer

    Declare Function JPN_Citizenship Lib "gsdkpcsc.dll" _
    Alias "_JPN_Citizenship@4" _
    (ByVal pbCitizenship As String) As Integer

    Declare Function JPN_Race Lib "gsdkpcsc.dll" _
    Alias "_JPN_Race@4" _
    (ByVal pbRace As String) As Integer

    Declare Function JPN_Religion Lib "gsdkpcsc.dll" _
    Alias "_JPN_Religion@4" _
    (ByVal pbReligion As String) As Integer

    Declare Function JPN_EastMsian Lib "gsdkpcsc.dll" _
    Alias "_JPN_EastMsian@4" _
    (ByVal pbEastMsian As String) As Integer

    Declare Function JPN_RJ Lib "gsdkpcsc.dll" _
    Alias "_JPN_RJ@4" _
    (ByVal pbRJ As String) As Integer

    *******************************************************/
    Attached Images Attached Images

  2. #2
    Join Date
    Jul 2005
    Posts
    4

    my dll error

    below is my VB code..

    Private Sub cmd_read_Click()
    Dim nResult As Integer
    Dim nPort As Integer
    Dim sRdrName As String
    Dim lResult As Long

    nResult = OpenReader
    nPort = 1
    sRdrName = "IRIS SCR30U 0"
    lResult = cardConnect(nPort, sRdrName, Len(sRdrName))
    nResult = SelJPNApp()

    Dim MyKadName As String
    Text1.Text = IDNum
    IDNum = ""
    nResult = JPN_IDNum(IDNum)
    nResult = CardDisconnect()
    nResult = CloseReader()
    End Sub

    when i run F8, at nResult = JPN_IDNum(IDNum) it says cnnot find dll entry point for _JPN_IDNum@4..why?

    below is my module..

    Option Explicit


    '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    ' General Declaration
    '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Declare Function OpenReader Lib "gsdkpcsc.dll" Alias "_OpenReader@0" _
    () As Integer ' open communication session with the card reader

    Declare Function cardConnect Lib "gsdkpcsc.dll" Alias "_CardConnect@12" _
    (ByVal port As Integer, ByVal Rdrname As String, ByVal nRdrLen As Integer) As Long
    ' open communication session with the card in the reader

    Declare Function CardDisconnect Lib "gsdkpcsc.dll" _
    Alias "_CardDisconnect@0" _
    () As Integer
    ' Closes communication session with the card in the reader

    Declare Function CloseReader Lib "gsdkpcsc.dll" Alias "_CloseReader@0" _
    () As Integer
    ' Closes communication session with the card reader

    Declare Function CardDetect Lib "gsdkpcsc.dll" Alias "_CardDetect@4" _
    (ByVal pcExplanation As String) As Integer
    ' Checks if card is in card reader

    Declare Function ResetCard Lib "gsdkpcsc.dll" Alias "_ResetCard@0" _
    () As Long
    ' Reset the card

    Declare Function GetError Lib "gsdkpcsc.dll" Alias "_GetError@0" _
    () As Integer
    ' returns information on last error that occured

    Declare Function SelJPNApp Lib "gsdkpcsc.dll" Alias "_SelJPNApp@0" _
    () As Integer
    ' select JPN to read JPN data


    '*************************************************************************
    ' JPN section
    '*************************************************************************

    Declare Function JPN_OrgName Lib "gsdkpcsc.dll" _
    Alias "_JPN_OrgName@4" _
    (ByVal pbOrgName As String) As Integer
    'original name in 150 bytes

    Declare Function JPN_MyKadName Lib "gsdkpcsc.dll" _
    Alias "_JPN_MyKadName@4" _
    (ByVal pbMyKadName As String) As Integer
    ' 3 lines of name stored in blocks 0f 30+30+20=80

    Declare Function JPN_KPTName Lib "gsdkpcsc.dll" _
    Alias "_JPN_KPTName@4" _
    (ByVal pbKPTName As String) As Integer
    ' KPTName is 40bytes , 2 lines of name stored in blocks of 20+20=40

    Declare Function JPN_IDNum Lib "gsdkpcsc.dll" _
    Alias "_JPN_IDNum@4" _
    (ByVal pbIDNum As String) As Integer
    ' ID number in 13bytes

  3. #3
    Join Date
    Apr 2007
    Posts
    1
    pls post ur gsdkpcsc.dll so i can try ur code.

Similar Threads

  1. Thanks!!! Re: call c/c++ function from VB
    By Chris in forum VB Classic
    Replies: 1
    Last Post: 08-08-2002, 11:02 AM
  2. Can API call VB function?
    By Chris in forum VB Classic
    Replies: 1
    Last Post: 02-27-2002, 02:04 PM
  3. AnimateWindow API
    By Tim Manos in forum VB Classic
    Replies: 4
    Last Post: 10-19-2001, 06:06 AM
  4. Replies: 2
    Last Post: 06-05-2001, 01:55 PM
  5. I am helpless - Edit Info form
    By Dan in forum VB Classic
    Replies: 0
    Last Post: 03-17-2000, 05:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center