What dll's should be distributed with MFC ActiveX control


I have developed a MFC ActiveX control in Visual Studio 2008. It is a simple control that checks registry keys. I have compiled release version and packaged it in .cab file. ActiveX control works fine in web browser on the machines that have Visual Studio 2008.

However, it does not get registered on machines that do not have Visual Studio 2008. It seems to be some missing Dlls issue.

Please let me know which dlls should be packaged in .cab file along with .ocx file for ActiveX control to work on machines that do not have Visual Studio 2008. ActiveX control is used in HTML Web Page in Internent Explorer.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can try Dependency Walker to detect it:

It does not always work in such cases when you need to register an ActiveX.
You can launch REGSVR32.EXE on the target computer in the command line and you will see the error.

So I think it will help if you can install Redistributable Package

This package is installed independently from you cab and before it.
sunil1863Author Commented:
I have tried Static Linking of MFC in Visual Studio 2008 and able to get the ActiveX control downloaded to client browser and run. I tried it in Vista, Windows 7. My requirement is that user should not have to be prompted for installing the VC redistributable package. ActiveX control should automaticall work from the web page without any prompts or manual installs.
It is absolutely correct. The question is only one - why you used an MFC code in it?
Check all dependencies, use single-threaded C run-time libraries, try to link MFC statically,...
Better was to develop your control with ATL only.
Firstly be sure that this redistributable package really helps. If we do not know it for sure, we are just speculating here.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
>>>> You can launch REGSVR32.EXE on the target computer in the command line and you will see the error.

I would go that way pgnatyuk has suggested. Open a command window and navigate to the folder where your axtive-x resides and call regsvr32:

 cd \myprojects\myactivex\Release
 regsvr32 myactivex.ocx

The regsvr32 tries to launch the active-x and will output error messages if a linked dll is missing.

You could retrieve that missing dll from the distribution kit or from system32 folder of your developer machine. Simply put it in the same folder where  active-x is and try again.

Probably only the current mfcxx.dll and the current msvcrtxx.dll were missing where xx is 90 for VS2008.
sunil1863Author Commented:
I used Static Linking to MFC eventually. The redistributable MFC hint gave me the idea to go for static linking of MFC.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.