0

I have a VB6 ActiveX DLL that's been working fine for many years. It has modal forms.

I changed it to an ActiveX EXE so that it can be instantiated by 64-bit programs. I do understand the performance hit.

It's working, but now of course the modal forms don't act modal with respect to the client program.

What are best practices for getting a form in an out-of-process ActiveX exe to act modal with respect to the client program?

Greg Lovern
  • 958
  • 4
  • 18
  • 36
  • 1
    Did you already checked the Coffe project under the VB Samples? This implies you should change the main executable. [How Modal and Modeless Forms Behave Out of Process](https://msdn.microsoft.com/en-us/library/aa262309%28v=vs.60%29.aspx) – deblocker Jan 01 '17 at 13:24
  • Yes, I read that. In my case, the main executable is MS Excel. The Coffee sample shows the problem; I'm asking if there is a solution other than just not doing it. – Greg Lovern Jan 01 '17 at 21:18
  • Can't you paste the code into Excel VBA Class. –  Jan 01 '17 at 21:40
  • Noodles, sure, but Excel is not a secure environment. Anything I do in Excel VBA can be undone by a malicious user. My DLL is compiled to binary. – Greg Lovern Jan 01 '17 at 22:54
  • @GregLovern: just a hint: both accepted answers here should give you some light how to do that: http://stackoverflow.com/questions/3045126/problems-in-showmodal-after-assigning-to-setparent and http://stackoverflow.com/questions/16872126/the-correct-way-of-getting-the-parent-window - If you already are experienced in WinAPI there should be no problem to translate Delphi to VB/VBA – deblocker Jan 02 '17 at 09:52

0 Answers0