Redistributing ActiveX component (ocx)

Posted on 2003-03-26
Medium Priority
Last Modified: 2013-11-25
Have developed a ActiveX component in (visual studio win2000)C++ and now whants it to be distributed and started from my webbpage:
1.User gets in webbpage
     check if Component installed
     if not, install and register component
     then start application

2.The way it is now I can't even manually install and register ocx on other computers, even if I copies the whole project and compiles again:
      when trying to register I get LoadLibrary(xxx.ocx) failed.
3. Which files must be distributed to make ActiveX componets work?

My question is how to do 1,3 and why 2 i happening

Question by:tankthall
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8210768
Have you registered the component using Regsvr32?
You should call regsvr32 your_ocx_name to add the control entries into the Windows registry.

Your OCX should be exporting a function called DLLRegisterServer. If you used the wizard to generate your component frame, that function should be right there, between the global functions of the module.

Essentially, the regsvr32 loads the library (OCX), obtains the pointer to the DLLRegisterServer function and calls it.

Have you proceeded with these steps?

Expert Comment

ID: 8210789
To install an ocx on a foreign computer:
*it should be copied to c:\windows\system
*then "Regsvr32.exe NameOfYourStuff.ocx" should be run to make windows recognize it. (I guess that's what wasn't done and because of this it didn't work.)

This if you sit before the computer, I have no idea of how to do it from a webpage

Author Comment

ID: 8211290
I have tried to reg xxx.ocx with resvr32 resulting in error: LoadLibrary failed

But the main question is how to make i autoinstall, when visitor gets in to my webbpage... like any other ActiveX componets do when I enter webbpage with ActiveX component.

When I redistribute ActiveX comp. via LAN it works in differnt computer, but if the same computer visits (after deleting activeX comp.) webbpage with exactly the same files it fails:

ActiveX comp inserted in webpage by object-tag, ocx and inf-fil zipped into cab-file makes it work localy but not by weppage why?

Accepted Solution

tkalchev earned 360 total points
ID: 8216588
You can try to do 2 things :

1. If you have InstallShield Developer Software, then you can build so called "Web Setup", the software will create a Web-page for you, which will install your ocx or whatever on any computer.

2. You can add CODEBASE into the OBJECT tag :

Now your declaretion  looks like :

<OBJECT id=SOME_ID classid=clsid:SOME_CLSID>
<PARAM NAME="SomeParameter1" VALUE="SomeValue">


Make it like :

<OBJECT id=SOME_ID classid=clsid:SOME_CLSID
<PARAM NAME="SomeParameter1" VALUE="SomeValue">


Where http://www.your.web.server.com/somedir/setupfile.cab is teh full URL of your CAB file, containing the oc, inf and any other files, required for the ocx to work.

Consider http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/codebase.asp for any other options of CODEBASE directive

Author Comment

ID: 8217210
Allready found second solution, but a good answer so you get may points... thanks!


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question