|
| |

Visual-Basic Einsteiger| Re: Wie übergibt man ein UDT-Array? | |  | | Autor: Daniel | | Datum: 21.04.02 19:29 |
| Hi Lordchen,
der Fehler ist immer noch "ByRef argument type mismatch" und springt auf "nUDTPtr":
amount_of_Disk_Devices = ScanSCSI(nUDTPtr, True)
So hab ich`s im Ganzen:
Private Type SCSI_Info
Hald As Long 'Host Adapter ID
Target As Long 'SCSI Target
lPtrName As String 'Ptr auf String mit 64 Bytes
BlockSize As Long 'Size of one logical Block
Amount_of_Blocks As Long 'Anzahl of logical Blocks
End Type
Private Declare Function InitializeDLL Lib _
"DVimage.dll" Alias "Init_WNASPI32" () As Long
Private Declare Function ScanSCSI Lib _
"DVimage.dll" Alias "Scan_SCSI_Bus" _
(ByRef lptrSCSIInfo As String, ByVal nTrueFalse As Byte) As Long
Private Declare Sub SCSIPrevent Lib _
"DVimage.dll" Alias "SCSI_Prevent_Medium_Removeal" _
(ByRef lptrSCSIInfo As Long, ByVal nTrueFalse As Long)
Private Declare Function StoreImage Lib _
"DVimage.dll" Alias "Store_Image" _
(ByRef lptrSCSIInfo As Long, ByVal Drive As Long, _
ByRef sPtrFileName) As Integer
Private Declare Function MakeImage Lib _
"DVimage.dll" Alias "Make_Image" _
(ByRef lptrSCSIInfo As Long, _
ByVal Drive As Long, ByRef sPtrFileName) As Long
Private Declare Sub CopyMemory Lib _
"kernel32" Alias "RtlMoveMemory" _
(pDst As Any, pSrc As Any, ByVal ByteLen As Long)
' // Global Variables ... SCSI_Info mySCSI_Info[100];
' // Information about 100 (who owns them?) SCSI drives
Private mySCSI_info(100) As SCSI_Info
' // amount of SCSI Disk Devices connected to PC
Private amount_of_Disk_Devices As Long
Sub Main()
Dim rVal As Long, nUDTPtr As Long
Dim jn As Integer
Dim nDrive As Integer
'Zeiger auf UDT-Array
nUDTPtr = VarPtr(mySCSI_info(0))
' WNASPI32.DLL initialisieren
rVal = InitializeDLL()
If rVal = 0 Then
MsgBox "WNASPI32.DLL not present or no SCSI Host Adapters found!", vbCritical, "Abbruch"
Exit Sub
End If
' // scan SCSI Bus for Disk drives and store Disk Drive(s) information and amoun of Disk Drives
' // also prevent medium removal for all found disk devices
amount_of_Disk_Devices = ScanSCSI(nUDTPtr, True)
' // If no Disk Devices were found exit.......
If amount_of_Disk_Devices = 0 Then
MsgBox "No SCSI Disk Drives found!", vbExclamation, "Abbruch"
Exit Sub
End If
show_devices
' Im nachfolgenden wird gefragt, ob man eine Image erstellen
' will oder eine Image speichern will.
jn = MsgBox("Wollen Sie eine Image erstellen oder eine Image speichern. " & String(2, vbCrLf) & "Drücken Sie wenn Sie eine Image erstellen wollen." & vbCrLf & "Drücken Sie wenn Sie eine Image speichern wollen." & vbCrLf & "Drücken Sie wenn Sie die Aktion abbrechen wollen", vbQuestion + vbYesNoCancel, "Frage:")
If jn = vbCancel Then Exit Sub
If jn = vbYes Then 'Image erstellen
nDrive = InputBox("Bitte geben Sie die Nummer des Laufwerks ein:", "Laufwerkauswahl")
If nDrive < 0 Or nDrive > amount_of_Disk_Devices Then Exit Sub
' Im nachfolgenden ist ein Pfad "hardgecodet"
MakeImage nUDTPtr, nDrive, "C:test.sdi"
End If
If jn = vbNo Then 'Image in Drive speichern
nDrive = InputBox("Bitte die Nummer des Laufwerks an.", "Dateiangabe erwartet")
If nDrive < 0 Or nDrive > amount_of_Disk_Devices Then Exit Sub
StoreImage nUDTPtr, nDrive, "C:test.sdi"
End If
Dat is ne schwere Geburt !!
End Sub |  |
 | Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
  |
|
Neu! sevDTA 3.0 Pro 
SEPA mit Kontonummernprüfung
Erstellen von SEPA-Dateien mit integriertem BIC-Verzeichnis und Konto- nummern-Prüfverfahren, so dass ungültige Bankdaten bereits im Vorfeld ermittelt werden können. Weitere InfosTipp des Monats Oktober 2025 Matthias KozlowskiUmlaute konvertierenErsetzt die Umlaute in einer Zeichenkette durch die entsprechenden Doppelbuchstaben (aus ä wird ae, usw.) TOP Entwickler-Paket 
TOP-Preis!!
Mit der Developer CD erhalten Sie insgesamt 24 Entwickler- komponenten und Windows-DLLs. Die Einzelkomponenten haben einen Gesamtwert von 1866.50 EUR...
Jetzt nur 979,00 EURWeitere Infos
|
| |
|
Copyright ©2000-2025 vb@rchiv Dieter Otter Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.
Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel
|
|