vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
vb@rchiv Offline-Reader - exklusiv auf der vb@rchiv CD Vol.4  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Fortgeschrittene Programmierung
Re: Immer noch probleme mit mailslots  
Autor: Michael17
Datum: 24.09.03 21:18

da isch noch mal der code mit dem ichs probiert habe:
Option Explicit
 
' öffentliche Programmvariablen
Private SlotHandle As Long
Private MySlot As String
 
' Konstanten für die CreateFile API's
Private Const OPEN_EXISTING = 3
Private Const GENERIC_READ = &H80000000
Private Const GENERIC_WRITE = &H40000000
Private Const GENERIC_EXECUTE = &H20000000
Private Const GENERIC_ALL = &H10000000
Private Const INVALID_HANDLE_VALUE = -1
Private Const FILE_SHARE_READ = &H1
Private Const FILE_SHARE_WRITE = &H2
Private Const FILE_ATTRIBUTE_NORMAL = &H80
 
' Konstanten für die CreateMailslot API's
Private Type SECURITY_ATTRIBUTES
  nLength As Long
  lpSecurityDescriptor As Long
  bInheritHandle As Long
End Type
 
Private tSA As SECURITY_ATTRIBUTES
 
' Client API's
Private Declare Function CreateFile Lib "kernel32" _
  Alias "CreateFileA" ( _
  ByVal lpFileName As String, _
  ByVal dwDesiredAccess As Long, _
  ByVal dwShareMode As Long, _
  lpSecurityAttributes As SECURITY_ATTRIBUTES, _
  ByVal dwCreationDisposition As Long, _
  ByVal dwFlagsAndAttributes As Long, _
  ByVal hTemplateFile As Long) As Long
 
Private Declare Function CreateFileNoSecurity Lib "kernel32" _
  Alias "CreateFileA" ( _
  ByVal lpFileName As String, _
  ByVal dwDesiredAccess As Long, _
  ByVal dwShareMode As Long, _
  ByVal Zero As Long, _
  ByVal dwCreationDisposition As Long, _
  ByVal dwFlagsAndAttributes As Long, _
  ByVal hTemplateFile As Long) As Long
 
Private Declare Function WriteFileSimple Lib "kernel32" _
  Alias "WriteFile" ( _
  ByVal hFile As Long, _
  ByVal lpBuffer As String, _
  ByVal nNumberOfBytesToWrite As Long, _
  lpNumberOfBytesWritten As Long, _
  ByVal Zero As Long) As Long
 
' Server API's
Private Declare Function ReadFileSimple Lib "kernel32" _
  Alias "ReadFile" ( _
  ByVal hFile As Long, _
  ByVal lpBuffer As String, _
  ByVal nNumberOfBytesToRead As Long, _
  lpNumberOfBytesRead As Long, _
  ByVal Zero As Long) As Long
 
Private Declare Function CreateMailslot Lib "kernel32" _
  Alias "CreateMailslotA" ( _
  ByVal lpName As String, _
  ByVal nMaxMessageSize As Long, _
  ByVal lReadTimeout As Long, _
  lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long
 
Private Declare Function GetMailslotInfo Lib "kernel32" ( _
  ByVal hMailslot As Long, _
  lpMaxMessageSize As Long, _
  lpNextSize As Long, _
  lpMessageCount As Long, _
  lpReadTimeout As Long) As Long
 
Private Declare Function CloseHandle Lib "kernel32" _
  (ByVal hObject As Long) As Long
 
 
 
Private Sub Form_Load()
  ' bedarf wohl keiner Erklärung ;)
  Timer1.Interval = 100
  Timer1.Enabled = False
End Sub
Private Sub cmd_CreateSlot_Click()
  If txt_MySlot.Text = "" Then Exit Sub
  If Left$(txt_MySlot.Text, 13) <> "\\.\mailslot\" Then Exit Sub ' Name korrekt ?
 
  ' SlotName und MaxDateigröße übergeben
  SlotHandle = MailSlotCreate(txt_MySlot.Text, 400)
 
  ' Falls erfolgreich geöffnet, zyklisch nach
  ' Dateien schauen
  If SlotHandle > 0 Then
    Timer1.Enabled = True
  Else
    MsgBox "Der Mailslot konnte nicht erstellt werden.", vbCritical
  End If
End Sub
 
' Mailslot erstellen
Private Function MailSlotCreate( _
  ByVal SlotName As String, _
  MsgSize As Long) As Long
 
  Dim Handle As Long
 
  tSA.nLength = Len(tSA)
  tSA.lpSecurityDescriptor = 1
 
  If SlotName = "" Then
    ' kein Name angegeben?
    MailSlotCreate = -1: Exit Function
  End If
 
  ' Hier erhalten wir das Handle
  Handle = CreateMailslot(SlotName, MsgSize, 0, tSA)
 
  MailSlotCreate = Handle
End Function
 
Private Sub Timer1_Timer()
  Dim MsgText As String
  Dim MSize As Long
  Dim MsgCount As Long
  Dim SlotInfo As Long
  'Dim BytesRead As Long
  Dim BufferSize As Long
 
  ' GetMailslotInfo gibt uns Auskunft über den Mailslot
  ' MSize   = Maximale Dateigröße
  ' Buffersize = Größe der nächsten Datei im Mailslot
  ' MsgCount  = Anzahl der Dateien im Mailslot
 
  SlotInfo = GetMailslotInfo(SlotHandle, MSize, _
    BufferSize, MsgCount, 0)
________________________________________________________________________________________________________________________________________



Freeware Programme, Tools, Tutorials und Controls auf >> <<
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
an alle: automatische Serversuche etwas schneller1.823Michael1720.07.03 21:30
Re: an alle: automatische Serversuche etwas schneller422XXX21.07.03 08:42
Re: an alle: automatische Serversuche etwas schneller814TheNukeduke21.07.03 12:06
Re: an alle: automatische Serversuche etwas schneller783Michael1721.07.03 17:03
Re: an alle: automatische Serversuche etwas schneller870TheNukeduke21.07.03 17:44
Re: an alle: automatische Serversuche etwas schneller728E721.07.03 20:52
Re: an alle: automatische Serversuche etwas schneller720TheNukeduke21.07.03 21:01
Re: an alle: automatische Serversuche etwas schneller744Michael1722.07.03 20:47
Re: an alle: automatische Serversuche etwas schneller760E721.07.03 17:12
Re: an alle: automatische Serversuche etwas schneller754Michael1722.07.03 20:45
Re: an alle: automatische Serversuche etwas schneller696TheNukeduke22.07.03 21:00
Re: an alle: automatische Serversuche etwas schneller719Michael1722.07.03 21:06
Re: an alle: automatische Serversuche etwas schneller677TheNukeduke22.07.03 21:13
Re: an alle: automatische Serversuche etwas schneller718Michael1722.07.03 21:19
Re: an alle: automatische Serversuche etwas schneller199Piekarek91@aol....23.07.03 21:07
Re: an alle: automatische Serversuche etwas schneller699Michael1724.07.03 06:38
Re: an alle: automatische Serversuche etwas schneller702E724.07.03 10:37
Re: an alle: automatische Serversuche etwas schneller685Michael1725.07.03 15:49
Re: an alle: automatische Serversuche etwas schneller190Piekarek91@aol....25.07.03 19:51
Re: an alle: automatische Serversuche etwas schneller655Michael1725.07.03 21:58
Re: an alle: automatische Serversuche etwas schneller161Piekarek91@aol....26.07.03 19:14
Re: an alle: automatische Serversuche etwas schneller711E726.07.03 22:57
Re: an alle: automatische Serversuche etwas schneller693Michael1728.07.03 17:12
Re: an alle: automatische Serversuche etwas schneller751TheNukeduke28.07.03 20:01
Re: an alle: automatische Serversuche etwas schneller668Michael1729.07.03 06:35
Re: an alle: automatische Serversuche etwas schneller678TheNukeduke29.07.03 11:08
Re: an alle: automatische Serversuche etwas schneller689Michael1729.07.03 18:13
Re: an alle: automatische Serversuche etwas schneller664Michael1701.08.03 12:24
Re: an alle: automatische Serversuche etwas schneller687E701.08.03 16:31
Re: an alle: automatische Serversuche etwas schneller669Michael1708.08.03 21:55
Re: an alle: automatische Serversuche etwas schneller682TheNukeduke09.08.03 09:34
Re: an alle: automatische Serversuche etwas schneller703Michael1710.08.03 15:58
Re: an alle: automatische Serversuche etwas schneller723E716.08.03 11:34
Re: an alle: automatische Serversuche etwas schneller675Michael1707.09.03 16:36
Re: an alle: automatische Serversuche etwas schneller678E708.09.03 12:30
Re: an alle: automatische Serversuche etwas schneller700Michael1710.09.03 17:57
Re: an alle: automatische Serversuche etwas schneller670Piekarek12.09.03 17:07
Re: an alle: automatische Serversuche etwas schneller677Michael1712.09.03 21:21
Re: an alle: automatische Serversuche etwas schneller640Piekarek12.09.03 21:51
Re: an alle: automatische Serversuche etwas schneller783Michael1713.09.03 21:44
Re: an alle: automatische Serversuche etwas schneller720E714.09.03 19:10
Re: an alle: automatische Serversuche etwas schneller631Piekarek14.09.03 19:37
Re: an alle: automatische Serversuche etwas schneller718E716.09.03 14:15
Immer noch probleme mit mailslots 1.258Michael1718.09.03 21:18
Immer noch probleme mit mailslots Teil 2719Michael1718.09.03 21:19
Re: Immer noch probleme mit mailslots Teil 2734E720.09.03 19:40
Re: Immer noch probleme mit mailslots Teil 2653Piekarek20.09.03 20:02
Re: Immer noch probleme mit mailslots Teil 2701E720.09.03 20:20
Re: Immer noch probleme mit mailslots 681TheNukeduke21.09.03 14:09
Re: Immer noch probleme mit mailslots 776E723.09.03 19:24
Re: Immer noch probleme mit mailslots 664Michael1705.10.03 17:49
Re: Immer noch probleme mit mailslots 659TheNukeduke06.10.03 17:37
Re: Immer noch probleme mit mailslots 625Michael1706.10.03 21:40
Re: Immer noch probleme mit mailslots 686Michael1724.09.03 19:33
Re: Immer noch probleme mit mailslots 637TheNukeduke24.09.03 20:42
Re: Immer noch probleme mit mailslots 663Michael1724.09.03 21:10
Re: Immer noch probleme mit mailslots 607Michael1724.09.03 21:18
Re: Immer noch probleme mit mailslots 561Michael1724.09.03 21:20
Re: Immer noch probleme mit mailslots 648TheNukeduke24.09.03 22:38
Re: Immer noch probleme mit mailslots 637Michael1725.09.03 21:23
Re: an alle: automatische Serversuche etwas schneller630Michael1724.09.03 19:37
Re: an alle: automatische Serversuche etwas schneller711E725.09.03 19:27
Re: an alle: automatische Serversuche etwas schneller643Michael1725.09.03 21:26
Re: an alle: automatische Serversuche etwas schneller641TheNukeduke25.09.03 21:45
sorry alter nick693Mike30.09.03 14:47
Sorry, Mailslots mein Irrtum682Michael1702.10.03 20:55
Re: Sorry, Mailslots mein Irrtum662TheNukeduke03.10.03 12:25
Re: Sorry, Mailslots mein Irrtum737Michael1705.10.03 14:32
Re: Sorry, Mailslots mein Irrtum653TheNukeduke06.10.03 17:30
Re: Sorry, Mailslots mein Irrtum571Michael1706.10.03 21:34
Re: Sorry, Mailslots mein Irrtum731TheNukeduke06.10.03 22:13
Re: Sorry, Mailslots mein Irrtum756Michael1708.10.03 16:26
Re: Sorry, Mailslots mein Irrtum651Michael1708.10.03 17:43
Re: Sorry, Mailslots mein Irrtum586TheNukeduke08.10.03 23:52
Re: Sorry, Mailslots mein Irrtum655Michael1709.10.03 20:54
Re: an alle: automatische Serversuche etwas schneller755Michael1712.10.03 20:27
Re: an alle: automatische Serversuche etwas schneller697--Florian--12.10.03 23:06
Re: an alle: automatische Serversuche etwas schneller624Michael1716.10.03 20:15
Re: an alle: automatische Serversuche etwas schneller552Piekarek16.10.03 20:41
Re: an alle: automatische Serversuche etwas schneller632Piekarek16.10.03 20:46
Re: an alle: automatische Serversuche etwas schneller604--Florian--16.10.03 22:01
Re: an alle: automatische Serversuche etwas schneller626Piekarek17.10.03 09:08
Re: an alle: automatische Serversuche etwas schneller580Michael1718.10.03 17:41
Re: an alle: automatische Serversuche etwas schneller663Michael1726.10.03 18:35
Re: an alle: automatische Serversuche etwas schneller633Michael1708.11.03 20:40
Re: an alle: automatische Serversuche etwas schneller620Enny08.11.03 21:46
Re: an alle: automatische Serversuche etwas schneller635Michael1708.11.03 22:28
Ausführung ohne Laufzeitkomponenten???674Michael1716.11.03 17:57
Re: Ausführung ohne Laufzeitkomponenten???654E718.11.03 19:41
Re: Ausführung ohne Laufzeitkomponenten???622Enny19.11.03 16:59
Re: Ausführung ohne Laufzeitkomponenten???629Enny20.11.03 14:34
Re: Ausführung ohne Laufzeitkomponenten???636Mike21.11.03 09:58
Re: Ausführung ohne Laufzeitkomponenten???640E730.11.03 13:11
Re: Ausführung ohne Laufzeitkomponenten???646Michael1703.12.03 20:31
würde mich über eine Antwort freuen!!!630Michael1727.11.03 12:00

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

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

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