ActiveX control '{XXX-XXX}' is not registered in this computer. Register the control and try again - visual-c++

While migration of old application, which built on VC6.0 framework. I am getting below error message when I tried to open Dialog box from Resource View windows.
The ActiveX control 6262D3A0-531B-11CF-91F6-C2863C338E30', is not registered on this computer. Register the control and try again.
Please suggest step to open the dialog. (Dialog having ActiveX control, which is absolute in latest window OS i.e. Window 10/11)
I tried to find ActiveX components on MS site, but no luck.

Two possibilities come to mind after you have ruled out that this is a standard Microsoft component:
It might be that this is a 3rd party component someone once bought. Look for an .ocx that might be present in the project files in a 3rd party folder. It could help, if you disclose the relevant lines in the resource file, so people have the chance to identify the component and with some luck tell you where you could get it.
There is a chance that this is a custom-made component: Look for a subproject and build it.
In any case register the component before use, for example regsvr32.exe path\to\your\component\the_comp.ocx. (On a 64-bit Windows, you might want to use C:\Windows\SysWOW64\regsvr32.exe, suppose this is a x86 project.)

Related

.NET Core / .NET 6: Creating a TLB or DLL that can be added as reference in VBA

I am trying to do basically what it says in the title: I have created a class library (dll) using .NET 6.0 and I would like to add that as a reference in an Excel/Access VBA document. I diligently followed the steps here:
https://learn.microsoft.com/en-us/dotnet/core/native-interop/expose-components-to-com
No matter what I try, I cannot add the resulting dll as a reference in Excel. I just keep getting the message: 'Can't add reference to the specified file'.
A bit more info: I am able to create the Assembly.comhost.dll file, and I think I have done everything correctly, but no joy.
This is rather frustrating, as doing this in .NET Framework is but a click of a couple of checkboxes. In .NET Core (.NET 6) It seems to be a bit of a nightmare. Also, being able to create a tlb from the dll was always a perfect confirmation that you would be able to add your reference in Excel.
ANY help is most welcome!
Thanks!
in the tutorial you hav ementioned, ther is a topic "Register the COM host for COM". here a file named "ProjectName.comhost.dll" is used to register the assembly to the registry as a COM type library.
After doing this, i could the assembly in VBS with the fowing conde:
set projectObject = CreateObject("ProjectNamespace.ProjectClass")
newValue = projectObject.ComputeNewValue("abc")
Right now, I was not able to establish a reference to that type library in my Excel 2016, but the code sample works in VBA as well.
I could also in VBA
Set projectObject = CreateObject("COMServer.Server")
MsgBox projectObject.ComputePi()
with this repository : https://github.com/dotnet/samples/tree/main/core/extensions/COMServerDemo
But that works only with Registered COM not with RegFree COM (Go check README).
Not every component is a suitable candidate for use under Reg-Free COM. A component is not considered suitable if any of the following are true:
The component is an out-of-process (ActiveX EXE) server. Only DLLs
are supported.
The component is a system component or part of the operating system,
such as XML, Data Access, Internet Explorer, or DirectX® components.
For example, you should not attempt to isolate components such as
Microsoft XML (MSXml.dll) or Microsoft Internet Controls
(SHDocVw.dll). These components are either part of the operating
system, or can be installed with a separate redistributable package.
The component is part of an application, such as Microsoft Office.
For example, you should not attempt to isolate components such as the
Microsoft Word Object Model or Microsoft Excel Object Model. These
two components are part of Office and can only be used on a machine
that has the full Office product installed on it.
The component is intended for use as an add-in or a snap-in, such as
an Office add-in or a control in a Web browser. Such components
typically require some kind of registration scheme defined by the
hosting environment that is beyond the scope of the manifest itself.
The other problem is an arbitrary application may not be designed to
recognize isolated components, as it probably doesn't have a way to
reference your component through a manifest.
The component manages a shared physical or virtual system resource.
For example, it could manage some kind of data connection shared
between multiple applications or a device driver for a print spooler.
Source : https://social.msdn.microsoft.com/Forums/en-US/cc08575d-3506-4a0f-a9e2-f23c2162ad38/using-net-excel-addin-with-registrationfree-com?forum=innovateonoffice
But I couldn't find a way to add it in Excel as a reference.

Overide Defaultappassociations.xml and let user select the application

I am working on Win 10 upgrade activity. As you know we can select application for file extension. So, those file will open on that app. e.g. html files only open in Chrome when user double click on that.
We can create XML file (DefaultAppAssociations.xml) and place it in C:\windows\system32
Now, I got the request to make one application default but let user decide if they want any other app. Is there any way to handle such things because defaultappassociations.xml will hard code this. Every time machine restart and it will set the same.
This is only possible as part of the operating system deployment or rather for newly created user profiles.
The command (official documentation):
Dism.exe /online /Import-DefaultAppAssociations:<path to exported xml>
However as I said you cannot alter existing profiles that way. Altering existing profiles in any way that is not the force via gpo is afaik not possible anymore because Microsoft does not want to allow it. A pretty stupid decision but at least you can tell whoever made the request that it is by MS design.

Refresh installation form of InstallShield application File

I created a setup file using InstallShield application.
Now, in one of the Installation Form, I have a checkbox control. By default it is unchecked. But after performing some operation on that form, I wants to check that checkbox control.
I am able to change its property, but the form is not getting refreshed.
Please Help me.
Thanks.
This is a known limitation in Windows Installer internal UI. Either roll an external UI handler ( InstallScript MSI project type for example ) or rethink your UI story to conform to what MSI is capable of doing.

VBA Calendar Control Different Versions Issue

I've built a simple Excel tool that uses the additional Calendar Control(mscal.ocx). Everything worked out fine, on different systems, however, the calendar seems not to be implemented and instead of just not showing the date picker, the whole form crashes.
Is there a way to implement the calendar control so that it runs on every system? Or do I have to code a datepicker myself?
(Office12)
Whenever you're using controls that aren't native to all operating systems and versions of excel, you're asking for trouble on other computers. Often, when developing, you'll have access to forms that don't exist on most systems, and only exist on yours because you have Visual Studio installed, or a special Microsoft Office package. Whenever such a problem occurs you have 3 choices:
Work your ass of to try and package the missing controls (mscal.ocx), and try to create a deployment script for your users which will copy it to the System32 directory and register it. This is a pain because there is usually a large chain of dependencies for a single control.
Deal with the fact that some systems won't support your tool and warn users upfront or provide a virtual machine that they can access that and that your tool will run on.
Reinvent whatever fancy control you're using with basic buttons, list-boxes, drop-downs, images, etc, which is the biggest pain of all and often requires you to compromise some nice functionality.
I've had to do number 3 countless times for excel 2007 tools that work on XP systems, but not Vista+ where certain ActiveX controls (i.e. Datagrid) are no longer supported.
i would build against Excel 10 (2003) as not everyone might have new Office 12 (2010).
or see if you can reference that ocx locally and deploy with your excel file
You can do this without the calendar controls.
Like this example here

WebBrowser Control: Is there a good documentation on browsing local files and folders?

I am using the WebBrowser control to browse local files and folders, but the control seems to be designed primarily to browse the Web (as its name implies).
I need to be able to do common tasks, like using the "Up one level" button, or put the control in "File Search" mode, get the active item, etc.
Is there a way to do these things using this control?
Is there a comprehensive documentation somewhere to explain local browsing using the WebBrowser?
Thanks all.
Here is a good intro that should help you get started on this. Most of the work with this dialog will be done by the browser, you need only to prompt it how to open the dialog.
I think you may be confusing the WebBrowser control with Windows Explorer.
If you want to browse around your local file system, then you need to add an Open File Dialog to the form containing the Web Browser control, then have a button of some kind open that dialog to locate the file to load into the WebBrowser control.

Resources