Solved

Modeless Dialog in ActiveX DLL

Posted on 2001-07-18
3
713 Views
Last Modified: 2010-04-06
This code in VB is an ActiveX DLL:

Project LibXX
Class ClaseX
Public Sub ShowDialog()
  'This line show the dialog in modeless
  frmFormulario.Show vbModeless
End Sub

called from VB work well ...


But in Delphi i :

  frm := CreateOleObject('LibXX.ClaseX') as ClaseX;
  frm.ShowDialog; <-error

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)

thanks
0
Comment
Question by:Felixls
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 6294821
The dialog needs input from somewhere. In Delphi it's Application.Handle. I don't know how to link that to a VB ActiveX DLL. This thread is about it. Maybe it gives you an idea of what I mean:

http://groups.google.com/groups?hl=en&safe=off&ic=1&th=b48f6d79d504b670,3&seekm=uSN%24FDT89GA.263%40ntdwwaaw.compuserve.com#p
0
 

Author Comment

by:Felixls
ID: 6296447
Epsilon:

Thank you for your comment, I have redefined my question.

Seemingly the Delphi EXEs are not shown as a prepared "HOST" to show forms Modeless
0
 

Author Comment

by:Felixls
ID: 6301996
Thanks.

Felix.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now