A year ago, I posted a question/complaint about the apparent lack
of support for "ConnectObject" or "GetRef" in class code.

I had been attempting to instantiate a class from within an actX
object and then connect with events fired by that class (not the actX
object itself). This works well enough in "main line" vbs code, but
not (as best I can tell) in class code.

I recently tried to do the same thing, and failed again (groan!).
I even searched this ng, and found my previous disgruntled posting.

Then I remembered something, i.e., that you can refer to the current
instance of class code as "Me", within the class. It occurred to me
that "Me" might be equivalent (or even identical to) "GetRef". A
"GetRef" gives you an object whose default member calls the routine
which you specify. Likewise, if "Me" is a reference to the current
instance, then if one refers to "Me" in code, then one will also get
a call to the default member of "Me".

Cut to the chase. This did work the way I expected it would, and
I was then able to (in effect) do a "GetRef" in class code.

Here is an example (although referring to a proprietary actX (oSCO)
which is setting a "CBT Hook" to detect window openings). When it
detects a window opening, it will call me back with the information:

--- <snip> ---

' set an "ole callback" for the hookproc...
Set oSCO.SetCallBack = Me ' reference to the default member of THIS
instance

...

' this is "my hookproc" (called from real hookproc embedded in sco)...
Public Default Function myHookWndFunc(uMsg, wParam, lParam)

...

' and this is the "real" hookproc located in the actX (oSCO) object.
' it will intercept the hookproc calls and refer them back to script.
Public Function GenericHookProc(ByVal ncode As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Dim oCallBack As Object

Set oCallBack = m_oCallBack ' the ole callback
GenericHookProc = oCallBack(CVar(ncode), CVar(wParam), CVar(lParam))
End Function
--- </snip> ---

Note: there is no documentation about "Me", other than another
obscure ng posting by mikHar, way back in 2000. As an "undocumented-
and-unsupported" feature, one might justifiably be cautious about using
this, because in the past microsoft has abruptly "corrected" (i.e.,
removed) other undocumented-and-unsupported features. The "good news"
is that it will probably take an "act of congress" for microsoft to ever
do any further maintenance or support for vbs, so it is extremely
unlikely that "Me" will ever go away anytime in the foreseeable future.

cheers, jw