Welcome to ISAserver.org
Forums |
Register |
Login |
My Profile |
Inbox |
RSS
|
My Subscription |
My Forums |
Address Book |
Member List |
Search |
FAQ |
Ticket List |
Log Out
Signaling event
|
Users viewing this topic:
none
|
Logged in as: Guest
|
Login | |
|
Signaling event - 5.Feb.2005 1:58:00 PM
|
|
|
mosquitooth
Posts: 8
Joined: 28.Jul.2004
Status: offline
|
Hi,
I wrote the following VB script to create an event (and an alert) and then to signal it:
Dim root, array, alerts, events Dim g As New Guid("{34799513-52F5-4e7d-976A-B361D868B4F5}") Dim myalert, myevent
root = CreateObject("FPC.Root") array = root.GetContainingArray() alerts = array.Alerts Try events = array.RuleElements.EventDefinitions myevent = events.Add("TestAlert", "{34799513-52F5-4e7d-976A-B361D868B4F5}")
events.Save() myalert = alerts.Add("this is a test", "{34799513-52F5-4e7d-976A-B361D868B4F5}") myalert.Actions.SetSendMail("SendMail", "MailServer", "firewall", "mike@northwindtraders.com") myalert.Actions.Save() alerts.Save()
Catch 'already exists (either event or/and alert) events.ItemByGuid("{34799513-52F5-4e7d-976A-B361D868B4F5}").Signal() End Try
When I run this, an exception occurrs: 'System.Runtime.InteropServices.COMException' Invalid data type
Can anyone help me out of this?
Thanks Peter
|
|
|
|
RE: Signaling event - 16.Feb.2005 6:38:00 PM
|
|
|
Jim Harrison
Posts: 231
Joined: 5.May2001
From: Redmond, WA
Status: offline
|
You're trying to run VBScript code in a .NET development IDE; it won't work. You might want to get some books on VB.NET or C#.
|
|
|
|
RE: Signaling event - 6.Mar.2005 5:35:00 PM
|
|
|
mosquitooth
Posts: 8
Joined: 28.Jul.2004
Status: offline
|
?! There's no problem on using VBS code in a VB.NET project (at least the VB script I provided above). When I run this script as a VBS the result is just the same.
Greetings,
Peter
|
|
|
|
RE: Signaling event - 19.Mar.2005 1:27:00 AM
|
|
|
Jim Harrison
Posts: 231
Joined: 5.May2001
From: Redmond, WA
Status: offline
|
hmm... Somehow I doubt that running a vbscript outside of the .NET IDE still gives you an interop error. what is the error you get running within CScript?
|
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|