Does GfW supports COM?

58 views
Skip to first unread message

Nakamatsu Shinji

unread,
Nov 25, 2009, 8:21:48 AM11/25/09
to growl-fo...@googlegroups.com
Hi, brian.

I want to use Growl via COM (VB6, Excel, WSH etc.).
Is is possible?

I know it to be feasible to combine growlnotify command with
WScript.Shell object .
But, it is not COMish.

In other words, my question is as follows.

Does GfW supports COM?

Best regards.

--
snaka
http://sumimasen2.blogspot.com/
http://d.hatena.ne.jp/snaka72/

Brian Dunnington

unread,
Nov 25, 2009, 11:19:47 AM11/25/09
to growl-fo...@googlegroups.com
> Does GfW supports COM?

the answer is: yes and no =)

i do have a C# .NET assembly that is exposed via COM-Interop that i
have successfully used from a VB6 project. it does not have extensive
testing and i am not sure if all advanced features (especially
encryption) work properly, but for basic use, it works for me. (i have
only tried it from VB6, not Excel or other VBA type apps). behind the
scenes, the COM component is using the normal Growl .NET assemblies,
so the end user would still have to have .NET installed as well.

i am attaching what i have so you can take a look. the Growl.COM.zip
file contains Growl.COM.dll and Growl.COM.tlb as well as the two Growl
.NET assemblies that it relies upon. the GrowlVB.zip file contains a
super simple VB6 app that uses the Growl.COM class as an example.

please try it out and let me know if it works for you. i originally
planned to write a native COM object, but i wasnt sure if there was
much demand for it.
Growl.COM.zip
GrowlVB.zip

snaka

unread,
Dec 7, 2009, 9:31:47 AM12/7/09
to growl for windows
Thanks!!
I'll try it.
> Growl.COM.zip
> 49K表示ダウンロード
>
> GrowlVB.zip
> 3K表示ダウンロード

snaka

unread,
Dec 9, 2009, 8:02:56 AM12/9/09
to growl for windows
Hi

I tried to use GfW with VBScript.

But, it failed.

My code is as follows.
---
set growl = WScript.CreateObject("Growl.COM.Connector")

set app = WScript.CreateObject("Growl.COM.Application")

dim types(0)
set types(0) = WScript.CreateObject("Growl.COM.NotificationType")
with types(0)
.Name = "notify"
.DisplayName = "notify"
.Enabled = True
end with

growl.Register app, types
---

I ran the code, and it was failed. (error message is as follows)
---
D:\Home\snaka\myproject\lang\wsh>cscript growl.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

D:\Home\snaka\myproject\lang\wsh\growl.vbs(13, 1) Microsoft VBScript
runtime error: Invalid procedur
e call or argument: 'growl.Register'

---

Any idea?

Brian Dunnington

unread,
Dec 9, 2009, 12:36:07 PM12/9/09
to growl-fo...@googlegroups.com
i havent tried using the components from VBScript, but i will try out
your code and let you know what i find out.


2009/12/9 snaka <snak...@gmail.com>:
> --
>
> You received this message because you are subscribed to the Google Groups "growl for windows" group.
> To post to this group, send email to growl-fo...@googlegroups.com.
> To unsubscribe from this group, send email to growl-for-wind...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/growl-for-windows?hl=en.
>
>
>

Brian Dunnington

unread,
Dec 9, 2009, 9:32:00 PM12/9/09
to growl-fo...@googlegroups.com
there were three issues:

1. you have to call growl.ConfigureLocal() or growl.ConfigureRemote()
before you try to use Register or Notify (that initializes the object
by setting any connection information)

2. the arguments to Register and Notify have to have parentheses
around them. i dont know the exact reason, but it has to do with
Interop and byval and byref

3. the Register function in the COM wrapper i gave you will never work
from VBScript. since it takes an array as the second parameter (array
of notification types), the COM object method must take these
parameters as object[] instead of NotificationType[]. i added another
method called Register2 that works with VBScript (and left the
original Register with strongly-typed arrays for languages that have
strong types).

i am attaching a new COM dll as well as a working VBScript example.
this worked for me - hopefully it will work for you as well.


2009/12/9 Brian Dunnington <briandu...@gmail.com>:
growl.vbs.txt
Growl.COM.zip

Nakamatsu Shinji

unread,
Dec 11, 2009, 12:35:15 PM12/11/09
to growl-fo...@googlegroups.com
I tried your sample code ( fix app name , notification name etc...)
It works fine!!

the code that i tested is here:
http://gist.github.com/253245

Thank you for your help.

2009年12月10日11:32 Brian Dunnington <briandu...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages