On Windows XP machines compiling a VB 5.0/6.0 project may fail with the following error:
System Error &H80070583 (-2147023485). Class does not exist.
This will happen only if a manifest file is used for VB5.EXE or VB6.EXE and the project or its dependents do not have an explicit reference to COMCTL32.OCX.
_Мика_ писал(а):Я думаю что MSDN
Исправлял иррациональность в программном коде
Antonariy писал(а):Скомпилированный в pcode работает.
Public Declare Function Opendll Lib "SPC_Driver.dll" Alias "Open" (ByVal SetDose_Delegate As Long, _
ByVal GetDose_Delegate As Long, _
ByVal CancelDose_Delegate As Long, _
ByVal HoldPump_Delegate As Long, _
ByVal UpdateFillingOver_Delegate As Long, _
ByVal InsertCardInfo_Delegate As Long, _
ByVal SaveReciept_Delegate As Long, _
ByVal SystemName As String, _
ByVal ctx As Long) As Byte
Public SystemName As String
Public ctx As Long
Public Declare Function Closedll Lib "SPC_Driver.dll" Alias "Close" () As Long ' çàêðûòèå äðàéâåðà
Public Declare Function SettingsSPCdll Lib "SPC_Driver.dll" Alias "Settings" () As Long 'âûçîâ ôîðìû íàñòðîéêè äðàéâåðà
Public Declare Function ServiceSPCdll Lib "SPC_Driver.dll" Alias "Service" () As Long 'âûçîâ ôîðìû ñåðâèñ
Public Declare Function CloseShiftSPCdll Lib "SPC_Driver.dll" Alias "CloseShift" () As Long ' ôóíêöèÿ çàêðûòèÿ ñìåíû
Public Declare Function FuelPrices Lib "SPC_Driver.dll" (ByVal Fuels As String) As Long 'îïðåäåëåíèå äîñòóïíûõ âèäîâ òîïëèâà ïåðåä íà÷àëîì ðàáîòû äðàéâåðà
Public Declare Function PumpFuels Lib "SPC_Driver.dll" (ByVal PumpsInfo As String) As Long 'ïðèâÿçêà äîñòóïíûõ âèäîâ òîïëèâà ê ïîñòàì
Public Declare Function Descriptiondll Lib "SPC_Driver.dll" Alias "Description" () As String 'îïèñàíèå äðàéâåðà
Public Declare Function FillingOver Lib "SPC_Driver.dll" (ByVal bTransNum As Currency, ByVal bQuantity As Long, ByVal bAmount As Long) As Long 'ôóíêöèÿ çàâåðøåíèÿ íàëèâà, êîòîðàÿ ñîîáùàåò äðàéâåðó êîëè÷åñòâî è ñòîèìîñòü îòïóùåíîãî òîïëèâà è íîìåð
Public Declare Function GetTransactiondll Lib "SPC_Driver.dll" Alias "GetTransaction" (ByVal ID1 As Currency, ByVal Result As Long) As Long 'çàïðîñ ñîñòîÿíèÿ ÒÐÊ äðàéâåðîì
Public Type GetTransactionResult 'îïðåäåëåíèå ñòðóêòóðû äëÿ çàêàçà áåíçóáåðîì
PumpNo As Long
PaymentCode As Long
ProductCode As Long
OrderMode As Long
Quantity As Long
Price As Long
Amount As Long
CardNO As String
OrderRRN As String
End Type
Public getTransRes As GetTransactionResult 'ñòðóêòóðà çàêàçà áåíçóáåðà
Public Type GetPumpStateResponce 'îïðåäåëåíèå ñòðóêòóðû ñîñòîÿíèÿ ÒÐÊ äëÿ îáìåíà ñ äðàéâåðîì
DispStatus As Byte '1
StateFlags As Integer '2 Integer
ErrorCode As Long '4 Long
DispMode As Byte '1
UpNozz As Byte '1
UpFuel As Byte '1
UpTank As Byte '1
TransID As Currency '8
'TransID2 As Long '4
PreselMode As Byte '1
PreselDose As Double '8
PreselPice As Double '8
PreselFuel As Byte '1
PreselFullTank As Byte '1
FillingVolume As Double '8
FillingPrice As Double '8
FillingSum As Double '8
End Type
Public getPumpSR As GetPumpStateResponce 'ñòðóêòóðà ñîñòîÿíèÿ ÒÐÊ äëÿ îáìåíà ñ äðàéâåðîì
Public Type benSPC
nGaszuber As Currency
lTimer As Long
FlageTrans As Byte '
bFree As Byte ' 1 - ñâîáîäíà, 0 - çàíÿòà
PaymentCode As Long
ProductCode As Long
OrderMode As Long
Quantity As Long
Price As Long
Amount As Long
CardNO As String
OrderRRN As String
End Type
Public Function SetDose_Delegate(ByVal Pump As Long, ByVal CardType As Long, ByVal ctx As Long) As Currency 'Long
On Error Resume Next
Dim n As Byte
If Pump > 0 Then
n = Pump - 1
Else
SetDose_Delegate = -0.0001
End If
If (glOperator > 0) And (gGasStation(n).gdFlagCheck = False) And (gGasStation(n).lStage = 0) And (gbDibitFlag(n) = False) And (gbQueryPurseFlag(n) = False) And (gGasStation(n).gbFlagLock = False) Then
Zuber(n).bFree = 0 '
SetDose_Delegate = nBenzuber '
Zuber(n).FlageTrans = 2 '
Zuber(n).lTimer = timeGetTime '
Zuber(n).nGaszuber = nBenzuber
End If
End Function
Public Sub BenzOpen() 'ïîäêëþ÷àåì äðàéâåð
'SystemName = "Pack=4;DumpMemory;" 'äëÿ ëîãîâ ñòðóêòóðû
SystemName = "Pack=4;"
Dim b As Byte
b = Opendll(AddressOf SetDose_Delegate, _
AddressOf GetDose_Delegate, _
AddressOf CancelDose_Delegate, _
AddressOf HoldPump_Delegate, _
AddressOf UpdateFillingOver_Delegate, _
AddressOf InsertCardInfo_Delegate, _
AddressOf SaveReciept_Delegate, _
SystemName, ctx)
Debug.Print "open dll" & CStr(b)
nBenzuber = 0 'äëÿ äðàéâåðà 1=10000, 2=20000
End Sub
Teranas писал(а):Drag
Автору надо взяться за проект попроще.
1) Option Explicit надо использовать везде и во всех модулях и классах и формах, это в разы снизит количество ошибок
2) Переходы по меткам - дурная привычка, от неё надо избавляться и чем раньше - тем лучше, для выхода из циклов есть Exit For и Exit Do
3) Что-то мне подсказывает, что это код не ваш, но вы хотите его довести до ума, это хорошо...
Сейчас этот форум просматривают: AhrefsBot и гости: 39