zboonet
Messages postés6Date d'inscriptionjeudi 30 novembre 2000StatutMembreDernière intervention12 novembre 2008
-
1 févr. 2006 à 10:33
zboonet
Messages postés6Date d'inscriptionjeudi 30 novembre 2000StatutMembreDernière intervention12 novembre 2008
-
9 févr. 2006 à 14:41
Hello :-)
Bon voila .. je souhaiterai créer dans mon programme une section critique ( un truc elegant, pas la pauv' variable booléenne trop crado et le DoEvents .. ).
En C, pas de problemes, je sais faire .. mais en VB .. j'ai encore du mal a toper les prototypes des API .. :-(
donc si qqn aurait par hasard devellopé ce genre de choses en VB .. je lui serait eternellement reconnaissant de bien vouloir partager ce petit bout de code .. :-)
Type LIST_ENTRY
pFlink As Long
pBlink As Long
End Type
Type RTL_CRITICAL_SECTION_DEBUG
Type As Integer
CreatorBackTraceIndex As Integer
pCriticalSection As Long
ProcessLocksList As LIST_ENTRY
EntryCount As Long
ContentionCount As Long
Spare(0 To 1) As Long
End Type
Type CRITICAL_SECTION
DebugInfo As RTL_CRITICAL_SECTION_DEBUG
LockCount As Long
RecursionCount As Long
OwningThread As Long
LockSemaphore As Long
SpinCount As Long
End Type
Declare Sub InitializeCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
Declare Sub DeleteCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
Declare Sub EnterCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
Declare Sub LeaveCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION)
Declare Function TryEnterCriticalSection Lib "kernel32" (ByRef lpCriticalSection As CRITICAL_SECTION) as Boolean