CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2000
    Posts
    24

    Createobject ,Second Parameter

    hi,

    i used createobject, to get the reference to component register in another computer..but it is throwing a runtime error 'Activex component can't create object'.
    i tried all the aptions, i register the component in another machine. and even i placed the lib files in my machine...

    can you advice the steps any thing i missed.

    thanx


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Createobject ,Second Parameter

    This problem happens when you use an ActiveX control in your program and the ActiveX control is not
    registered in the registry. If it works on the Development PC, it must be an incompatibillity between your
    control and the same control installed in the user PC. To fix this check which ActiveX controls you need in
    order to run your program and make sure all of them are placed in the SYSTEM folder. You should know which
    control is the one that's giving you so much trouble (it must be in the Form that crashes your program) so
    you'll have to manually register it. To do it you have two basic choices: Do it through Windows Explorer or
    through a DOS Prompt Window. If you are using the Explorer just drag and drop your
    control into REGSVR32.EXE (Both must be in the SYSTEM folder) or
    in the Dos Prompt window be sure you are in the SYSTEM folder
    and tye REGSVR32 [YourControlName].OCX After doing this you
    should see a message box saying that the registration process
    succeeded. If it fails, then you will have to dig inside the
    registry and find all the keys that references the control to
    delete them. Then you'll have to repeat the registration
    process.

    '============================================================================
    Error 429 means that there is a component that isn't correctly registered. The PDW is supposed to take care
    of this, but sometimes it forgets. I doubt its an ADO component, just because since it is referenced in
    different ways so the PDW couldn't overlook it. Does your project have any custom controls or DLLs that
    were written by you or your company. These it may not pick up and register properly. If you find that this
    problem is only occurring on one machine, see if you can manually register the suspected controls by going
    to the start-run menu and typing "regsvr32 <dll or ocx path and name>". if it still doesn't work - look into
    rebuilding the setup package with the PDW and examine every option and/or another setup packager
    (Wise or Install Shield).

    '=============================================================================

    Here's another clue:
    You are refrencing an ado library that is the latest and geratest on your machine but when you try
    to package the exe PDW by dafault picks up from its own repository of redistribution components which
    normally has a version which is older.
    So what happens the PDW picks up the ADO library all right automatically based on the Reference setting in
    your project but it picks up the older version.
    If this is the case then
    For this replace the Mdac_typ.exe in the
    C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Redist with the latest Mdac_typ.exe


    '============================================================================
    'check this
    Goto Project|References from the vb menu. Look for a ActiveX control that has MISSING next to it.
    If you see a missing that's the problem. It can't find it. Sometimes it is a activeX version problem, you may
    just need to pick a different version of the missing ActiveX control. Ot you may need to somehow install
    the missing control or not use it. As for where the debugger shows the problem, it's a red herring, just look
    for the MISSING control in references.




    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Aug 2000
    Posts
    24

    Re: Createobject ,Second Parameter

    hi,

    thanx for the answer you gave, but iam looking for a dll which is registered in other machine,and i want to refer the same dll from my machine...using createobject..using second parameter of create object which tells me the server name where the component is registered.
    i can refer to that object, and i can request the dll for a specific purpose...

    help me...

    suresh


  4. #4
    Join Date
    May 2001
    Posts
    1

    Re: Createobject ,Second Parameter

    Hi, first of all which is your progid so createobject(dllname.classname)
    second you can use strong, early, weak , late binding so these are things you got to keep in mind
    createobject will cause the proxy to call the stub on the other machine (here you got to be carefull when you use com+ server and library packages or mts)

    so if you considered these topics you can use all sort of bindings depending on the technic you use

    but first things first did you register your typelib => regtlib







  5. #5
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Createobject ,Second Parameter

    First, your Dll should be created with flag "Remote component"
    Then you will have a Tlb and a Vbr file.
    In client machine (where you want to build/launch a program which refer to remote dll) you should add the Vbr file (you can build the project on the machine where the dll is, add a reference to it and then -when deploying- for client remove dll and add vbr file).
    Let me know.

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured