这个代码无法运行,
因为这时是Cbank的成员函数Type HL_RESULT 
TicketType as byte 
 SerialNumber As  Long 
 ValueRemaining As  Long 
 DateofLastUse_Year As  Long 
 DateofLastUse_Month As  Long 
 DateofLastUse_Day As  Long 
 DateofLastUse_Hour As  Long 
 DateofLastUse_Minute As  Long 
 StationLastUse As  Long 
 DateofIssue_Year As  Long 
 DateofIssue_Month As  Long 
 DateofIssue_Day As  Long 
 TimeofIssue_Hour As  Long 
 TimeofIssue_Minute As  Long 
 DateofValid_Year As  Long 
 DateofValid_Month As  Long 
 DateofValid_Day As  Long 
 TotalRide As  Long 
 CurrentRide As  Long 
 EntryExitCode As  Long 
End TypeFunction Check_TIK(code(22) As byte,res as HL_RESULT) As  Long Varcode333=array(&He0,&H21,&H43,&H2d,&H2f,&H68,&H01,&H5b, 
&H17,&H5e,&H0a,&H00,&Hff,&H82,&H00,&H82,&H2a,&H5b,&Hd9,&H45,&H1e,&Hf9)
code=Varcode333
Dim codemy(22) As  byte
Dim pres as long 
Dim respack As  Long 
Dim paras(22) as double 
Dim sendtovb As  Long 
Dim isend as long,pone As  Long Function send1()as Double for isend=0 to 21
code333(isend)=paras(isend)
pres=varptr(respack)
pone= Check_TIK(code333,byval pres) 
sendtovb=res(TicketType)
send1= sendtovb
next End Function

解决方案 »

  1.   

    Private Type  RESULT  
    dim TicketType as string
    '以下依次修改
    ' 为dim ** as int 
    int SerialNumber 
    int ValueRemaining 
    int DateofLastUse_Year 
    int DateofLastUse_Month 
    int DateofLastUse_Day 
    int DateofLastUse_Hour 
    int DateofLastUse_Minute 
    int StationLastUse 
    int DateofIssue_Year; 
    int DateofIssue_Month; 
    int DateofIssue_Day; 
    int TimeofIssue_Hour; 
    int TimeofIssue_Minute; 
    int DateofValid_Year; 
    int DateofValid_Month 
    int DateofValid_Day 
    int TotalRide; 
    int CurrentRide; 
    int EntryExitCode; 
    end type private  function Check_TIK(const unsigned char code[22], struct _RESULT *res) as integer
     
    dim code333[22] as string
    '{0xe0,0x21,0x43,0x2d,0x2f,0x68,0x01,0x5b, 
    '0x17,0x5e,0x0a,0x00,0xff,0x82,0x00,0x82,0x2a,0x5b,0xd9,0x45,0x1e,0x'f9} dim  codemy[22] as string  
    dim res,respack as string
     
    double paras[22],sendtovb; 
    int isend,pone; private function send1() as long 
     
    for isend=0 to 21
    isend=isend+1 
    code333[isend]=paras[isend]; 
     res=respack; 
     pone= Check_TIK(code333, res); 
     sendtovb=res.TicketType; 
     send1=sendtovb
     next 

      

  2.   

    回复人: bdgyz(中关村) (  ) 信誉:100 
    我怎么看你这个不象VB
    也不象VC????
      

  3.   

    回复人: bdgyz(中关村) ( ) 信誉:100 
    unsigned int <> short int
    unsigned int =long
    short int=integer
      

  4.   

    我有个错误:
    sendtovb=res(TicketType) 
    应为:
    sendtovb=respack.TicketType
      

  5.   

    好像这一句就通不过阿
    Function Check_TIK(code(22) As byte,res as HL_RESULT) As Long