⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pccapiutils.vb

📁 以前做NOKIA手机与PC通信时所参考的源代码,里面包括两个程序,一个是手机文件夹浏览源码,另一个手机SIS安装程序.
💻 VB
📖 第 1 页 / 共 2 页
字号:
        ElseIf errorCode = ECONA_FILE_NO_PERMISSION Then
            CONAError2String = "ECONA_FILE_NO_PERMISSION: Not allowed to perform required operation to file in device or PC."
        ElseIf errorCode = ECONA_FILE_COPYRIGHT_PROTECTED Then
            CONAError2String = "ECONA_FILE_COPYRIGHT_PROTECTED: Not allowed to perform required operation to file in device or PC."
        ElseIf errorCode = ECONA_FILE_BUSY Then
            CONAError2String = "ECONA_FILE_BUSY: Other application has reserved file in device or PC."
        ElseIf errorCode = ECONA_FILE_TOO_BIG_DEVICE Then
            CONAError2String = "ECONA_FILE_TOO_BIG_DEVICE: Device rejected the operation because file size is too big."
        ElseIf errorCode = ECONA_FILE_TYPE_NOT_SUPPORTED Then
            CONAError2String = "ECONA_FILE_TYPE_NOT_SUPPORTED: Device rejected the operation because file has unsupported type."
        ElseIf errorCode = ECONA_FILE_NO_PERMISSION_ON_PC Then
            CONAError2String = "ECONA_FILE_NO_PERMISSION_ON_PC: Not allowed to perform required operation to file in PC."
        ElseIf errorCode = ECONA_FILE_EXIST Then
            CONAError2String = "ECONA_FILE_EXIST: File move or rename: File is copied to target path with new name but removing the source file failed."
        ElseIf errorCode = ECONA_FILE_CONTENT_NOT_FOUND Then
            CONAError2String = "ECONA_FILE_CONTENT_NOT_FOUND: Specified file content does not found (e.g. unknown file section or stored position)"
        ElseIf errorCode = ECONA_FILE_OLD_FORMAT Then
            CONAError2String = "ECONA_FILE_OLD_FORMAT: Specified file content supports old engine"
        ElseIf errorCode = ECONA_FILE_INVALID_DATA Then
            CONAError2String = "ECONA_FILE_INVALID_DATA: Specified file data is invalid"

            ' File System errors for folder functions:
        ElseIf errorCode = ECONA_INVALID_DATA_DEVICE Then
            CONAError2String = "ECONA_INVALID_DATA_DEVICE: Device's folder contains invalid data."
        ElseIf errorCode = ECONA_CURRENT_FOLDER_NOT_FOUND Then
            CONAError2String = "ECONA_CURRENT_FOLDER_NOT_FOUND: Current folder is invalid in device (e.g MMC card removed)."
        ElseIf errorCode = ECONA_FOLDER_PATH_TOO_LONG Then
            CONAError2String = "ECONA_FOLDER_PATH_TOO_LONG: Maximum folder path length is 255 characters."
        ElseIf errorCode = ECONA_FOLDER_NAME_INVALID Then
            CONAError2String = "ECONA_FOLDER_NAME_INVALID: Folder name includes invalid characters in Device or PC."
        ElseIf errorCode = ECONA_FOLDER_ALREADY_EXIST Then
            CONAError2String = "ECONA_FOLDER_ALREADY_EXIST: Folder already exists in target folder."
        ElseIf errorCode = ECONA_FOLDER_NOT_FOUND Then
            CONAError2String = "ECONA_FOLDER_NOT_FOUND: Folder does not exist in target folder."
        ElseIf errorCode = ECONA_FOLDER_NO_PERMISSION Then
            CONAError2String = "ECONA_FOLDER_NO_PERMISSION: Not allowed to perform required operation to folder in Device."
        ElseIf errorCode = ECONA_FOLDER_NOT_EMPTY Then
            CONAError2String = "ECONA_FOLDER_NOT_EMPTY: Not allowed to perform required operation because folder is not empty."
        ElseIf errorCode = ECONA_FOLDER_NO_PERMISSION_ON_PC Then
            CONAError2String = "ECONA_FOLDER_NO_PERMISSION_ON_PC: Not allowed to perform required operation to folder in PC."

            ' Application installation error:
        ElseIf errorCode = ECONA_DEVICE_INSTALLER_BUSY Then
            CONAError2String = "ECONA_DEVICE_INSTALLER_BUSY: Cannot start device's installer."

            ' Syncronization specific error codes:
        ElseIf errorCode = ECONA_UI_NOT_IDLE_DEVICE Then
            CONAError2String = "ECONA_UI_NOT_IDLE_DEVICE: Device rejects the operation. Maybe device's UI is not in idle state."
        ElseIf errorCode = ECONA_SYNC_CLIENT_BUSY_DEVICE Then
            CONAError2String = "ECONA_SYNC_CLIENT_BUSY_DEVICE: Device's SA sync client is busy."
        ElseIf errorCode = ECONA_UNAUTHORIZED_DEVICE Then
            CONAError2String = "ECONA_UNAUTHORIZED_DEVICE: Device rejects the operation. No permission."
        ElseIf errorCode = ECONA_DATABASE_LOCKED_DEVICE Then
            CONAError2String = "ECONA_DATABASE_LOCKED_DEVICE: Device rejects the operation. Device is locked."
        ElseIf errorCode = ECONA_SETTINGS_NOT_OK_DEVICE Then
            CONAError2String = "ECONA_SETTINGS_NOT_OK_DEVICE: Device rejects the operation. Maybe settings in Sync profile are wrong on Device."
        ElseIf errorCode = ECONA_SYNC_ITEM_TOO_BIG Then
            CONAError2String = "ECONA_SYNC_ITEM_TOO_BIG: Device rejected the operation"
        ElseIf errorCode = ECONA_SYNC_ITEM_REJECT Then
            CONAError2String = "ECONA_SYNC_ITEM_REJECT: Device rejected the operation"
        ElseIf errorCode = ECONA_SYNC_INSTALL_PLUGIN_FIRST Then
            CONAError2String = "ECONA_SYNC_INSTALL_PLUGIN_FIRST: Device rejected the operation"

            ' Versit conversion specific error codes:			
        ElseIf errorCode = ECONA_VERSIT_INVALID_PARAM Then
            CONAError2String = "ECONA_VERSIT_INVALID_PARAM: Invalid parameters passed to versit converter."
        ElseIf errorCode = ECONA_VERSIT_UNKNOWN_TYPE Then
            CONAError2String = "ECONA_VERSIT_UNKNOWN_TYPE: Failed, trying to convert versit formats not supported in VersitConverter."
        ElseIf errorCode = ECONA_VERSIT_INVALID_VERSIT_OBJECT Then
            CONAError2String = "ECONA_VERSIT_INVALID_VERSIT_OBJECT: Failed, validation of versit data not passed, contains invalid data."
            ' Database specific error codes:
        ElseIf errorCode = ECONA_DB_TRANSACTION_ALREADY_STARTED Then
            CONAError2String = "Another transaction is already in progress"
        ElseIf errorCode = ECONA_DB_TRANSACTION_FAILED Then
            CONAError2String = "Some of operations within a transaction failed and transaction was rolled back"

            ' Backup specific error codes:
        ElseIf errorCode = ECONA_DEVICE_BATTERY_LEVEL_TOO_LOW Then
            CONAError2String = "Failed, device rejects the restore operation. Device's battery level is low."
        ElseIf errorCode = ECONA_DEVICE_BUSY Then
            CONAError2String = "Failed, device rejects the backup/resore operation. Device's backup server busy."

        Else
            CONAError2String = "Undefined error code" ' shouldn't occur
        End If
    End Function

	'===================================================================
	' Long2MediaString --  Returns name of the media for given Long
	'
	'
	'===================================================================
	Public Function Long2MediaString(ByVal media As Integer) As String
        If media = API_MEDIA_IRDA Then
            Long2MediaString = "IrDA"
        ElseIf media = API_MEDIA_SERIAL Then
            Long2MediaString = "Serial"
        ElseIf media = API_MEDIA_BLUETOOTH Then
            Long2MediaString = "Bluetooth"
        ElseIf media = API_MEDIA_USB Then
            Long2MediaString = "USB"
        Else
            Long2MediaString = "Unknown media" ' shouldn't occur
        End If
    End Function

    '===================================================================
    ' ErrorMessageDlg --  Show an errormessage
    '
    '
    '===================================================================
    Public Sub ShowErrorMessage(ByRef strError As String, ByRef errorCode As Integer)
        Dim strMessage As String = strError & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Error: 0x" & Hex(errorCode) & Chr(13) & Chr(10) & CONAError2String(errorCode)
        MsgBox(strMessage)
    End Sub

    '===================================================================
    ' TrustedInfo2String
    ' 
    ' Converts file attributes to string
    ' 
    '===================================================================
    Public Function TrustedInfo2String(ByVal iTrustedInfo As Integer) As String
        TrustedInfo2String = ""
        If CONAPI_IS_DEVICE_UNPAIRED(iTrustedInfo) Then
            TrustedInfo2String += "Unpaired, "
        ElseIf CONAPI_IS_DEVICE_PAIRED(iTrustedInfo) Then
            TrustedInfo2String += "Paired, "
        End If

        If CONAPI_IS_PCSUITE_TRUSTED(iTrustedInfo) Then
            TrustedInfo2String += "Trusted "
        Else
            TrustedInfo2String += "Not trusted "
        End If
    End Function

    '===================================================================
    ' GetMediaString: 
    ' Converts the given media constant to a string format
    '===================================================================
    Public Function GetMediaString(ByVal iMedia As Integer) As String
        If iMedia = API_MEDIA_IRDA Then
            Return "IrDA"
        ElseIf iMedia = API_MEDIA_SERIAL Then
            Return "Serial"
        ElseIf iMedia = API_MEDIA_BLUETOOTH Then
            Return "Bluetooth"
        ElseIf iMedia = API_MEDIA_USB Then
            Return "USB"
        Else
            Return "Unknown Media"
        End If
    End Function
End Module

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -