VBプログラマ質問スレ(6.0以前) Part42
■ このスレッドは過去ログ倉庫に格納されています
0052デフォルトの名無しさん
2005/06/01(水) 19:21:01ExecNotificationQuery を使ってアプリケーションログの監視をしているのですが、
ときどき、TargetInstance.InsertionStrings に値が入っていないらしく
for each で「オブジェクトがコレクションではありません。」というエラーになります。
オブジェクトがコレクションかどうか確認する関数はありますか?
以下、該当部分のコード:
Set events = GetObject("winmgmts:{impersonationLevel=impersonate,(Backup, Security)}!\\.\root\CIMV2") _
.ExecNotificationQuery("select * from __instancecreationevent where targetinstance isa 'Win32_NTLogEvent' and targetinstance.EventType = 1")
do
set NTEvent = events.nextevent ()
for each str in NTEvent.TargetInstance.InsertionStrings
wscript.echo "InsertionStrings: " & str
next
loop
■ このスレッドは過去ログ倉庫に格納されています