Getting Unknown function label error on
SELF.LockQ &= NewCriticalSection()
My class clw…
MEMBER
INCLUDE('nxWorkX.inc'),ONCE
INCLUDE('CWSYNCHC.INC'),ONCE
MAP
INCLUDE('CWUTIL.INC'),ONCE
END
nxWorkX.Construct PROCEDURE()
CODE
SELF.LockQ &= NewCriticalSection()
SELF.QWork &= NEW typQ:Work
nxWorkX.Destruct PROCEDURE()
CODE
SELF.LockQ.Kill()
DISPOSE(SELF.QWork)
My class inc…
typQ:Work QUEUE, TYPE
FileName STRING(256)
tsRow REAL
END
nxWorkX CLASS, TYPE, MODULE('nxWorkX.clw'), LINK('nxWorkX.clw'), THREAD
LockQ &ICriticalSection, PRIVATE
QWork &typQ:Work, PRIVATE
You need to also Include CWSynchM.INC to get NewCriticalSection()
Bruce
3
You need a space between New and CriticalSection. It shoukd be 2 words, not one.
In the CWSYNCHM.INC file its 1 word “NewCriticalSection”:
MAP
MODULE('')
NewMutex (),*IMutex,C,NAME('NewMutex')
NewMutex (STRING name, BYTE Own = FALSE, <*LONG Err>),*IMutex,C,NAME('NewProcessMutexCla')
GetMutex (STRING name, <*LONG Err>),*IMutex,C,NAME('GetProcessMutexCla')
NewSemaphore (LONG initial=0,LONG max=1),*ISemaphore,C,NAME('NewSemaphore')
NewNamedSemaphore (STRING name, LONG initial=0,LONG max=1, <*LONG Err>),*ISemaphore,C,NAME('NewProcessSemaphoreCla')
GetSemaphore (STRING name, <*LONG Err>),*ISemaphore,C,NAME('GetProcessSemaphoreCla')
NewCriticalSection (),*ICriticalSection,C,NAME('NewCriticalSection')
NewReaderWriterLock (BYTE WritersHavePriority = TRUE),*IReaderWriterLock,C,NAME('NewReaderWriterLock')
END
END
Thx Carl.
That fixed it. I had checked the help and it did not identify this include.
~P