Python访问DLL数据

时间:2018-11-23 13:32:35

标签: python c++ dll

我对python不太熟悉,我正在从cctv获取数据。为此cctv创建了一个DLL文件,用户可以从中提取数据。我设法编写了一个c ++软件来使其运行,但是我无法将代码转换为python。我确定我的python文件必须先与此dll文件链接,因为我能够登录到CCTV,但无法提取数据。谢谢!

C ++文件:

case COMM_UPLOAD_PLATE_RESULT: {
        NET_DVR_PLATE_RESULT struPlateResult = { 0 };
        memcpy(&struPlateResult, pAlarmInfo, sizeof(struPlateResult));
        printf("Number: %s\n", struPlateResult.struPlateInfo.sLicense);
        }

dll文件:

typedef struct tagNET_DVR_PLATE_RESULT
{
    DWORD   dwSize;           
    BYTE    byResultType;   
    BYTE    byChanIndex; 
    WORD    wAlarmRecordID;    
    DWORD   dwRelativeTime;    
    BYTE    byAbsTime[32]; 
    DWORD   dwPicLen;      
    DWORD    dwPicPlateLen;  
    DWORD   dwVideoLen;        
    BYTE    byTrafficLight;   
    BYTE    byPicNum;      
    BYTE    byDriveChan;    
    BYTE     byVehicleType; 
    DWORD   dwBinPicLen;   
    DWORD   dwCarPicLen;    
    DWORD   dwFarCarPicLen; 
    BYTE    *pBuffer3;      
    BYTE    *pBuffer4;      
    BYTE    *pBuffer5;   
    BYTE    byRelaLaneDirectionType;
    BYTE    byCarDirectionType; 
    BYTE    byRes3[6];   
    NET_DVR_PLATE_INFO  struPlateInfo;   
    NET_DVR_VEHICLE_INFO struVehicleInfo; 
    BYTE    *pBuffer1;                  
    BYTE    *pBuffer2;                 
}NET_DVR_PLATE_RESULT, *LPNET_DVR_PLATE_RESULT;

typedef struct tagNET_DVR_PLATE_INFO
{
    BYTE  byPlateType;                    
    BYTE  byColor;                        
    BYTE  byBright;                        
    BYTE  byLicenseLen;                    
    BYTE  byEntireBelieve;                
    BYTE  byRegion;                      
    BYTE  byCountry;                      
    BYTE  byArea;                         
    BYTE  byPlateSize;                    
    BYTE  byRes[15];                     
    char  sPlateCategory[MAX_CATEGORY_LEN/*8*/];
    DWORD dwXmlLen;                       
    char* pXmlBuf;                   
    NET_VCA_RECT    struPlateRect;       
    char sLicense[MAX_LICENSE_LEN];       
    BYTE byBelieve[MAX_LICENSE_LEN];    
}NET_DVR_PLATE_INFO, *LPNET_DVR_PLATE_INFO;

0 个答案:

没有答案