Active Form in container control is visible but doesn't respond

572 Views Asked by At

I currently have a dll containing a TForm descendant that gets displayed when an exported function is called. The client applications have varying release cycles so this minimizes unnecessary changes to them when the dll has to change. There are well known problems with this approach stemming from dll and client apps having different instances of TApplication so I won't elaborate further. BPLs are the recommended solution to this problem but aren't currently an option because the client applications are compiled in different versions of Delphi (and I'd like to keep the option open for reuse in a few non-delphi applications as well).

To avoid these problems I am attempting to replace the dll with an ocx containing a self contained Active Form control that can be displayed in the client applications by dropping it onto a form either in a TOleContainer or as a wrapped control.

Using the documentation and some tutorials I created an ocx project, active form and registered it. I then set about getting it into a test application. I had no problem getting the control to display in a TOleContainer but it wouldn't respond to mouse or keyboard actions. I thought it might be a limitation of TOleContainer so I imported the ocx using "Import Component" and dropped the resulting VCL component wrapper onto my form. Same result. No response to any mouse or keyboard actions. (With the exception that right-clicking the control displays a "Properties" context menu)

I've read and reread the documentation and tutorials and don't see that I've missed any steps. According to them it "just works". I'm sure there is something I'm missing.

0

There are 0 best solutions below