#using <System.dll> using namespace System; using namespace System::Diagnostics; using namespace System::Threading; int main() { // Create the source, if it does not already exist. if ( !EventLog::SourceExists( "MySource" ) ) { //An event log source should not be created and immediately used. //There is a latency time to enable the source, it should be created //prior to executing the application