VC访问EventLog的问题
源代码:
#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
请高手指点!
问题点数:50、回复次数:2Top
1 楼lovenoend(有容乃大)回复于 2004-02-03 10:49:12 得分 40
看MSDN里C1190怎么解释Top
2 楼flyelf(空谷清音)回复于 2004-02-03 10:58:57 得分 10
#pragma comment(lib, "mscorlib.lib")Top




