Hello Sead!
I am terribly sorry for confusion. What I meant to say is that calling first function of DAQmx causes the other threads to fail while opening their initialization files and thus, the application "crahses" or stops executing and reports an error, which in my case is a feature (reporting error, not failing to read initialization file).
Regarding source code. The application is very object oriented and modular. Thus, pasting a code here would be useless without some long and exhausting description. I will try to explain the sequence in which things occur.
1) Application starts and creates 4 other threads in suspended mode.
2) Application then starts all threads one by one. Thread that is the only one which uses DAQmx is started first.
3) Initilaization of DIO starts. First function to call is DAQmxResetDevice.
4) Meanwhile, also initialization of other threads is triggered by main thread.
5) When one of the other threads tries to open a file using CFile class, it fails. Thus, the application ends with an error.
N.B. 1: It does not matter if first function called is DAQmxResetDevice. It can be any other valid DAQmx function call, like DAQmxCreateTask.
N.B. 2: If a delay of 10 ms is put in front of first DAQmx function call, the application works without any issues. All threads open ther initialization files and do their work.
N.B. 3: The application worked without any issues while using DAQ Traditional drivers and it hasn't been changed except changing form Traditional to mx drivers.
Best regards,
Vladimir Kocjancic