?
Solved

RunTime Error 406

Posted on 2002-04-19
2
Medium Priority
?
797 Views
Last Modified: 2008-02-20
Run-time error '406':

Non-modal forms cannot be displayed in this host application from an ActiveX DLL, ActiveX Control, or Property Page.

I get this error when I try to show a form modeless in an ocx loaded in IE.

The question is, why I don't get this error when I run the ocx from VB (in debug). Then the form apears normally.

How can I show a modeless form in IE also after I compile the ocx (not started from VB)?
0
Comment
Question by:Azmodan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
corvanderlinden earned 240 total points
ID: 6952772
Visual Basic enables you to test whether a client supports nonmodal forms through the App.NonModalAllowed read-only property.

If App.NonModalAllowed Then
    frmChart.Show
Else
    frmChart.Show vbModal
End If

If you consider that the vbModal constant is 1 and that the App.NonModalAllowed returns 0 or -1, you can do everything in just one statement:

frmChart.Show (1 + App.NonModalAllowed)

Unfortunately, you can't test this feature without COMPILING the component into an actual ActiveX DLL because the App.NonModalAllowed property always returns True when the program runs in the Visual Basic environment.

0
 

Author Comment

by:Azmodan
ID: 6952925
thanx man
i really didn't know about this property

it's somehow inconvenient for me...

see my other problem in this question
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20291272

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

718 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