Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating a Self-Registering Typelib for a WSC

34 views
Skip to first unread message

alex_k._angelopoulos_(mvp)

unread,
Jun 8, 2002, 2:18:39 AM6/8/02
to
So what's the *right* way to do this?

I've tried with the methods outlined in the help docs, but they don't seem to
work. One thing I have figured out is that the ProgID must be
Scriptlet.TypeLib, not Scriptlet.GenerateTypeLib...


Torgeir Bakken

unread,
Jun 9, 2002, 12:37:03 PM6/9/02
to

Be sure that you don't have the line
implements id="Behavior" type="Behavior"
in you WSC, or else the oTL.Write will err.

Here are the top part of the WSC I am using:

<?xml version="1.0" ?>
<component>
<registration progid="BWshLib.WSC"
classid="{c8e9c3f5-043b-4aa3-97b9-781681910643}"
description="BWshLib"
version="1.14">
<script language="VBScript">
<![CDATA[
Function Register()
set oTL = CreateObject("Scriptlet.TypeLib")
oTL.AddURL "BWSHLIB.WSC"
oTL.Path = "BWSHLIB.tlb"
oTL.Doc = "Brix WSH component"
oTL.GUID = "{63284c00-7a94-4336-9e07-3923e4470980}"
oTL.Name = "BWSHLIB_tbl"
oTL.MajorVersion = 1
oTL.MinorVersion = 1
oTL.Write
oTL.Reset
End Function

Function UnRegister()
End Function
]]>
</script>
</registration>
<public>
(snip method definitions and code)


I register it with this script line:
sRetVal = oShell.Run("regsvr32 /s " & "/i:" & """" & sB_ComPath & "\BWSHLIB.WSC"
& """" & " " & sWinSysDir & "\scrobj.dll", 1, True)

that transfers to something like this:
regsvr32 /s /i:"some path\BWSHLIB.WSC" C:\WINNT\SYSTEM32\scrobj.dll

--
torgeir


alex_k._angelopoulos_(mvp)

unread,
Jun 10, 2002, 1:33:25 AM6/10/02
to
The "implements" issue was the problem, Torgeir. I also had a moof in my
register function, and used yours to help straighten it out.

"Torgeir Bakken" <Torgeir.B...@hydro.com> wrote in message
news:3D03842F...@hydro.com...

0 new messages