Click here to Skip to main content
15,122,559 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Back in VS2017, When referencing an Activex/OCX two files were created and referenced on Visual Studio


from there I was able to create a wrapper around AxInterop.XYZLib.dll that exposed the methods and properties of the OCX as if they were native.

After installing VS2019 only Interop.XYZLib.dll is generated. Even if I go back to VS2017 the behavior is the same, only one is generated, and trying to use it causes a catastrophic failure.

Thank you

What I have tried:

Other answers suggest to use AxImp.exe, I tried, only to have an error saying "Did not find a registered ActiveX control in ...", that's confusing since the OCX is registered with RegSvr32.exe, any ideas?
Updated 10-Jul-20 6:24am
MadMyche 9-Jul-20 11:27am
Why did you delete the original question?
lenniscata 9-Jul-20 11:28am
I wanted to change the title to make it clearer.
OriginalGriff 9-Jul-20 11:33am
You can edit questions using the "Improve question" button at the bottom (wave the mouse over your question and it'll appear) and edit the text, title, tags, and "what I have tried" sections.

Deleting questions looks like a "I didn't get the answer I wanted" fit of pique, and generally doesn't get you any improvements. It does annoy some of us though ...
lenniscata 9-Jul-20 11:40am
Ok, got it, thank you,
MadMyche 9-Jul-20 11:34am
That's what the Improve Question widget is for
Patrice T 9-Jul-20 12:33pm
Use Improve question to update your question.
Patrice T 9-Jul-20 11:29am
What says microsoft ?
lenniscata 9-Jul-20 11:39am
To use AxImp.exe, it should create both files but it comes back with "Did not find a registered ActiveX control in ...", but I registered the control.

Thank you
CHill60 9-Jul-20 12:37pm
Did you use the correct version of RegSvr32.exe to register the OCX? 32bit vs 64bit
lenniscata 9-Jul-20 16:09pm
Yes, 32 bit, I got the message "DLLRegisterServer in ArsOle.ocx succeded." and I'm still able to use the version compiled on VS2017 with not issue. I just can't import it again to a new project. Thank you
MadMyche 9-Jul-20 12:35pm
Is your app 32 or 64 bit? And that ActiveX?
lenniscata 9-Jul-20 16:12pm
It is 32 bit COM library that will be access by a 32 bit application. running on Windows 10, build 2004, VS 2019 all patched. Thank you,
CHill60 10-Jul-20 5:40am
Not sure where all of the comments have gone, but try using Sysinternals Process Utilities - Windows Sysinternals | Microsoft Docs[^] - specifically the Process Monitor and Process Explorer tools. They will help you find out which dependant DLL it's moaning about or where it's looking for it
lenniscata 10-Jul-20 14:18pm
Thank you, I was able to generate the files with AxImp, but VS2019 is still crashing, although the VS2017 solution is working. I'll try your suggestion and post here what I find.

1 solution

The most correct answer is, don't use activex... It's a known security risk and is to be avoided at all costs.

EDIT 2020.12.24 =======================

I can tell by the number of reputation points I lost (2) as a result of the recent down-vote, that the down-voter was a low-reputation CP user who probably has little/no experience actually writing enterprise-level code. So to that individual, listen up, and learn.

Active-X is a KNOWN security risk, and is even outright banned from use by the entirety of the DoD software development as a result.

The only browser that supports it is IE, and since MS has essentially abandoned IE, and Flash is no longer supported in many modern browsers, there's even less impetus for its continued use.

Find another way.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900