Scripltlet.TypeLib .tlb from multiple .wsc files

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
koolezt
Posts: 15
Joined: Sat Dec 15, 2007 1:00 pm

Scripltlet.TypeLib .tlb from multiple .wsc files

Post by koolezt »

I hope this is the correct forum. My problem is with the language-independent part of WSH, although I'm using jScript rather than VBScript.

I've made a few components and registered them. Each one is by itself in a separate .wsc script-component package file. In script I can create a type library for any one of them with something like this.

Code: Select all

var oTL=new ActiveXObject('Scriptlet.TypeLib');
with (oTL) {
    AddURL('handy.tool1');    //    one is OK, multiple AddURL()s fail
    Path=str_tlPath;
    Name=str_tlProgID;
    MajorVersion=int_tlVerMajor;
    MinorVersion=int_tlVerMinor;
    Doc=str_tlTitle;
    Write();
    Reset();
}    //    end with
The problem comes when I use multiple "AddURL('handy.tooln')" statements - with unique valid "handy.tooln" entries, of course. The type-library-creation fails at "Write()" with "unknown exception".

Temporarily, I'm using multiple single-package type-libraries, but that seems a bit wasteful.



I seem to be missing something. Can anyone help?

EDIT: clarifying packaging

koolezt2008-03-05 03:03:54

User avatar
koolezt
Posts: 15
Joined: Sat Dec 15, 2007 1:00 pm

Scripltlet.TypeLib .tlb from multiple .wsc files

Post by koolezt »

Answering some queries:Yes, all paths are valid; each single-component .tlb can be created and registered.Point taken about Reset(), I just included that as specified in the documentation. In any case, the failure is in the statement before the Reset().Security issue? I'm logged in as an Administrator with default (full) priveleges.Agreed, registering the .wsc gives it full functionality, the .tlb is for coding accuracy and convenience. The feature is provided and documented: It should work.

jvierra
Posts: 14616
Joined: Tue May 22, 2007 9:57 am
Answers: 3
Has voted: 1 time
Been upvoted: 3 times
Contact:

Scripltlet.TypeLib .tlb from multiple .wsc files

Post by jvierra »

Sometime later today I will rty an analyze this withthe debugger in Visual studio. I may kick up an answer for you. Or - you could use VS and VB or C# to duplicate your code and see what the debuuger tells you.

I agree that it should work. Youare probably missing a global declaration.

Documentation examples are notoriously faulty beyond trivial demonstrations.

It may ve easirer to use SDK tool to dump registry image of typelib to a file from registry definition then edit the file directly.
jvierra2008-03-07 03:57:01

Locked