Click to See Complete Forum and Search --> : Createobject ,Second Parameter
sureshm
May 15th, 2001, 06:18 AM
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
Iouri
May 15th, 2001, 07:02 AM
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
iouri@hotsheet.com
sureshm
May 16th, 2001, 10:55 AM
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
stevensteven
May 16th, 2001, 03:05 PM
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
Cimperiali
June 5th, 2001, 05:51 AM
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.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.