Link to home
Start Free TrialLog in
Avatar of sunil1863
sunil1863

asked on

What dll's should be distributed with MFC ActiveX control

Hi,

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.

Regards,
Sunil
Avatar of pgnatyuk
pgnatyuk
Flag of Israel image

You can try Dependency Walker to detect it:
http://www.dependencywalker.com/

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
http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en

This package is installed independently from you cab and before it.
Avatar of sunil1863
sunil1863

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of pgnatyuk
pgnatyuk
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start 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:

 c:
 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.
I used Static Linking to MFC eventually. The redistributable MFC hint gave me the idea to go for static linking of MFC.