VC访问EventLog的问题
zrcat 2004-02-02 06:12:39 源代码:
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::Diagnostics;
using namespace System::Threading;
int main(){
if(!EventLog::SourceExists(S"MySource")){
EventLog::CreateEventSource(S"MySource", S"MyNewLog");
Console::WriteLine(S"CreatingEventSource");
}
// Create an EventLog instance and assign its source.
EventLog* myLog = new EventLog();
myLog->Source = S"MySource";
// Write an informational entry to the event log.
myLog->WriteEntry(S"Writing to event log.");
}
提示错误:
atal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
请高手指点!