My solution in VC++2012 includes some executable programs & some DLLs. One of project is DataReceiver which output is a program, dataReceiver.exe. One DLL is called DataInterface, whose output is DataInterface.dll.
In main program of DataReceiver, it declares an object DataIn via class DataInput, which is defined at DataInterface project. I inserted some logging message and then found strange things happen: the DataIn's constructor seems being skipped. The detail is described as below:
The snippet of main program of DataReceiver is as below:
int main(int argc, char* argv)
logMsg ("standebug: DataReceiver/main()\n");
logMsg ("standebug: DataReceiver/main():try\n");
cout << "K00.00.15.06.01\nNow:"<< boost::posix_time::to_iso_string(boost::posix_time::microsec_clock::local_time()) << endl;
logMsg ("standebug: DataReceiver/main():to start()\n");
And the DataInput's constructor begins as:
m_mode = 0;
logMsg ("standebug: DataInput::DataInput\n");
cout << "standebug: DataInput::DataInput\n";
m_OnChangedFn_ptr = NULL;
The DataInput's method, Start() begins as:
logMsg ("standebug: dataInput: Start\n");
After building them successfully, I ran 'DataReceiver.exe' under MS Command Prompt, I found the logging message is as:
standebug: DataReceiver/main():to start()
It's very obviously, after DataIn is declared, neither DataIn.DataInput() or DataIn.Start() had been executed, why?
From logging message, DataIn's constructor is never ran. How come?