Modeless Dialog in ActiveX DLL
Posted on 2001-07-18
This code in VB is an ActiveX DLL:
Public Sub ShowDialog()
'This line show the dialog in modeless
called from VB work well ...
But in Delphi i :
frm := CreateOleObject('LibXX.ClaseX') as ClaseX;
I recive an error something like that:
"Can not show dialog modeless in ActiveX DLL"
How i can do this in delphi like vb?
The problem is explained in the MSDN:
Modeless Dialog Boxes Sometimes Aren't Allowed
When you create an ActiveX DLL, you'll have one limitation: Depending on the container, modeless dialog boxes may or may not be displayed. For example, imagine that you've created an ActiveX DLL that includes an ActiveX document that shows a modeless form. If you view the document in Office Binder, showing the modeless form will present no problems. On the other hand, if you view the same document in Internet Explorer, attempting to display the same modeless form will raise an error.
Note With Internet Explorer 4.0 or later, the ability to show modeless forms is dependent on the threading model. This is discussed in "Apartment-Model Threading in Visual Basic" in "Building Code Components."
(sorry for my english)