Results 1 to 4 of 4

Thread: idl to tlb can't create object error

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    3

    idl to tlb can't create object error

    Created a tlb from an idl. The idl has an import statement for the msstask.idl that contains the interface and method definitions for the windows task scheduler.

    my idl:

    import "unknwn.idl";
    import "mstask.idl";
    import "oaidl.idl";

    [uuid(385B2C1C-04E5-4477-A8A4-5F98307618E9), version(1.1), helpstring("Task Trigger Test2")]

    library RbTaskTriggerLib {
    importlib("stdole32.tlb");
    [uuid(6B05647F-CD6E-41fe-97A8-5E8F4B5E4E78)]

    coclass RBTaskTriggerTest
    {
    [default] interface ITaskScheduler;
    interface ITask;
    interface ITaskTrigger;
    interface IPersistFile;
    interface IScheduledWorkItem;
    };
    };

    VB project has a reference to the tlb. Object Browser shows the interfaces and methods defined in the mstask.idl as it should. The coclass is declared as follows:

    'Dim ptasksch As New RBTaskTriggerTest'

    However, I receive an error with the following line:

    'ptasksch.SetTargetComputer (computer)'

    The error is 'Runtime error 429 - ActiveX component cannot create object'.

    Can someone enlighten me on the source of this problem?

  2. #2
    New Member
    Join Date
    May 2003
    Posts
    10
    'Runtime error 429 - ActiveX component cannot create object' simply means that the components CLSID can't be found in the CLSID section of the registry.

    Make sure the component is registered and try again.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    3
    The type library was registered however the coclass was not. I added the registry entry and ran my code and still received an error. I think my problem has to do with a fundamental lack of understanding of COM.
    I am a bit confused on how you can call an interface method (mstask.idl included in Task Trigger Test tlb) and have the implementation (mstask.dll) execute. I have read from several sources that a VB program can access an interface using a type library derived from the interface's idl and call the interface methods. Up to now, in order to employ the system objects (that Microsoft refused to provide a typelibrary for) from VB, I have used C++ ATL to create dual interface dlls that serve as wrappers around the Microsoft system objects. I then call the wrapper dll from vb. This time I decided to attempt to generate a type library that could be accessed by VB. It looks as though it will be easier to continue using the ATL. Still, if you are familiar with the mstask.idl and how I can create a type library that will work with VB, let me know.

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    3
    I believe I know what the problem was. In my idl I should have been referencing the CLSID_CScheduledTask Guid listed in the mstask.idl in the uuid attribute of RBTaskTriggerTest. This is what makes the connection between the interface and the implementation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width