5

I have a 3rd party legacy app that requires a VB6 Active X EXE library interface. I am looking to update the VB6 Active X EXE library to a currently supported language. As the legacy host application is from a 3rd party I do not have the ability to change the host API to use an interface other than ActiveX EXE. Is there any currently supported Microsoft language i.e., x86 C++, C++/CLI, C# or VB.NET that can create the equivalent of an ActiveX EXE interface?

I suspect the answer is no but am looking for a definitive response saying so. That any legacy host application using ActiveX EXE library must be itself be modified to allow the use of supported languages and tools. Basically confirming that effectively ActiveX EXE is now an unsupported API interface.

I've already looked at this similar question and from it one could deduce that the answer is no but there is no definitive response. I've also looked at this Microsoft Tutorial and from what I can tell it talks about updating the host application which isn't an option in this case. The tutorial talks about switching to an ActiveX DLL but my understanding is that this would require a change to the 3rd party host application. Again that is not an option in my case. I need something that looks like an ActiveX EXE library to the host.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
JonN
  • 2,498
  • 5
  • 33
  • 49
  • 3
    Why does it need to be "currently supported"? Amazingly enough VB6 still works so why cant you use that? – Ňɏssa Pøngjǣrdenlarp Jan 16 '18 at 20:54
  • 3
    Because it is already a difficult environment to work in and going forward I only expect it to get worse. Currently I have been unable to get VB6 to install on Win10 (and I've made multiple attempts on multiple systems) so I am forced to develop on Win7. Then there are the little annoyances like mouse wheel doesn't work and there is no facility for pre or post build events. And then there are other interfaces we'd like to use that require .NET environment. And then there's the issue that VB6 isn't fully object oriented. – JonN Jan 16 '18 at 21:15
  • We've got an XP machine set up for our VB6 stuff. Good times... (just kidding, currently our project is to convert all VB6 code to VB.NET and DTSX). – Jacob H Jan 16 '18 at 21:17
  • 6
    You can make a VB6 ActiveX Exe wrapper, and [reference a COM Visible .Net assembly](http://zbz5.net/consuming-net-assemblies-vb6) where you will do most of your development. – djv Jan 16 '18 at 21:47
  • @djv your solution looks like a viable alternative. So far the only viable one I've found. So if I understand correctly I would take my existing VB6 ActiveX EXE and gut it so that only the headers for interface methods remained then create a .NET COM visible library that implements the Active X library and put calls to each of the .NET COM visible library methods into each of the now wrapper methods in the gutted VB6 Active X EXE. – JonN Jan 17 '18 at 00:45
  • 1
    JonN: since you mentioned some specific niggles: there are [fixes for the mouse wheel](https://stackoverflow.com/questions/1039673/how-can-i-make-mousewheel-work-in-vb6-ide) and you can [build VB6 projects from the command-line](https://stackoverflow.com/questions/24084562/how-to-catch-errors-while-executing-vb-project-using-nant/24087059#24087059) which might allow pre/post build processing. However I fully understand (and share) a desire to use .NET for your development work. – MarkJ Jan 17 '18 at 12:45
  • I believe COM+ GAC Windows services can turn a NET assembly to behave like COM ActiveX EXE – Siyon DP Jan 17 '18 at 14:05
  • @MarkJ Yes I am already building from the command line to get post build code signing operation. Another annoyance is that the early version of Studio for VB6 doesn't reload externally modified source files without exiting VB6 and restarting. I do a lot of my editing in an external editor. – JonN Jan 17 '18 at 21:53
  • @ TSion.D.P I'm not familiar with GAC Windows services. Is this a Windows product or from a 3rd party. Link? – JonN Jan 17 '18 at 21:55
  • Are you referring to this utility? https://learn.microsoft.com/en-us/dotnet/framework/tools/gacutil-exe-gac-tool – JonN Jan 17 '18 at 22:07
  • 1
    @JonN install the VBAdvance plugin to the VB6 IDE for the auto-code-reload feature. – StayOnTarget Jan 18 '18 at 12:43
  • Can you clarify exactly what the architecture you are dealing with is? Its not 100% clear to me what your actual question is. It sounds like maybe you have a VB6 project which produces an ActiveX EXE; that EXE provides a specific API which the third party code is looking for. Is that right? – StayOnTarget May 10 '18 at 19:38
  • Possible duplicate of [Create ActiveX.exe using .Net 4 and VS2010](https://stackoverflow.com/questions/6166762/create-activex-exe-using-net-4-and-vs2010) – StayOnTarget May 22 '18 at 16:45
  • Related: this question describes how to create an ActiveX EXE in Delphi. https://stackoverflow.com/questions/4376107/how-to-write-an-exe-which-is-also-a-com-server-in-delphi?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – StayOnTarget May 22 '18 at 16:50

1 Answers1

1

If you are sure that an ActiveX Exe is required, have you considered just using VB6 to create the that as a thin shim and then have it delegate all implementation to a .NET assembly? You probably would never need to recompile the Exe again, unless the 3rd party vendor is still expanding their interface.

If you post some more information about the VB6 Active X EXE library interface, I might be able to refine this solution with specific code samples. Presumably your Active X Exe must implement a provided interface?

tcarvin
  • 10,715
  • 3
  • 31
  • 52